You should wrap your code in backticks (you can highlight your code and click the
</> symbol in the editor to spawn the markdown necessary; this is context-sensitive, so it will create a block or inline tags based on your selection). Github has a great reference for this (as does the developer, but the code used here has some of the GFM additions, like code fencing, which is frankly a lot less work than indenting every line).
It would also be much easier to help you if you shared the whole package. If you posted a link to a github repo, I could clone it,
apm link to drop a symlink into my .atom/packages directory, reload a currently open Atom window, and be testing your grammar in less time than it takes to type this paragraph. With just two rules, I have no ability to observe the whole functioning of the package. I have to trust that you copied it correctly, and it’s not even preformatted. In order to figure out a solution, I would have to create a package and set it up as if I’m making a new language, or go and edit an existing language.
I went and tested it anyway, and I can’t find the solution to your problem because I haven’t been able to replicate it. I did find an error in my notes (regarding
endCaptures) and have fixed that.
successfully matches this
[ Should be code ]
<span class="source mux">
<span class="open code-bracket mux">[</span>
<span class="code-string mux"> Should be code </span>
<span class="close code-bracket mux">]</span>