Permalink
Browse files

Prevent self-closing `ref` tags from breaking highlighting.

When using a self-closing "ref" tag like `<ref name="foo"/>`, the syntax coloring would stop for the subsequent text.
  • Loading branch information...
1 parent bd0bf0b commit ab99cf8393dea81631753f856a6433a6df058549 @tbates tbates committed with infininight Jun 15, 2012
Showing with 45 additions and 0 deletions.
  1. +45 −0 Syntaxes/Mediawiki.tmLanguage
@@ -435,6 +435,8 @@
<string>meta.tag.inline.ref.mediawiki</string>
</dict>
</dict>
+ <key>comment</key>
+ <string>&lt;ref&gt;content&lt;/ref&gt; TODO: Redundant with named tag</string>
<key>contentName</key>
<string>meta.reference.content.mediawiki</string>
<key>end</key>
@@ -457,6 +459,8 @@
<string>meta.tag.inline.ref.mediawiki</string>
</dict>
</dict>
+ <key>name</key>
+ <string>meta.reference.mediawiki</string>
<key>patterns</key>
<array>
<dict>
@@ -466,6 +470,47 @@
</array>
</dict>
<dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>meta.tag.inline.ref.mediawiki</string>
+ </dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>entity.name.tag.ref.mediawiki</string>
+ </dict>
+ <key>4</key>
+ <dict>
+ <key>name</key>
+ <string>entity.name.tag.name.mediawiki</string>
+ </dict>
+ <key>5</key>
+ <dict>
+ <key>name</key>
+ <string>meta.tag.inline.ref.mediawiki</string>
+ </dict>
+ <key>6</key>
+ <dict>
+ <key>name</key>
+ <string>string.quoted.ref.name.mediawiki</string>
+ </dict>
+ <key>7</key>
+ <dict>
+ <key>name</key>
+ <string>meta.tag.inline.ref.mediawiki</string>
+ </dict>
+ </dict>
+ <key>comment</key>
+ <string>&lt;ref name="label"/&gt;</string>
+ <key>match</key>
+ <string>(&lt;)(ref) *((name) *(=) *([^&gt;]*))(/&gt;)</string>
+ <key>name</key>
+ <string>meta.reference.named.cite.mediawiki</string>
+ </dict>
+ <dict>
<key>begin</key>
<string>(&lt;)(ref) *((name) *(=) *([^&gt;]*))(&gt;)</string>
<key>beginCaptures</key>

0 comments on commit ab99cf8

Please sign in to comment.