Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Totally rewritten image/link rules, mirrors the actual Textile source…

… code where possible. Also changed scopes to the new pseudo-conventions.

The image and link attributes are currently matched but not scoped; wasn't sure what their scope should be so I left them as is.


git-svn-id: http://svn.textmate.org/trunk/Bundles/Textile.tmbundle@4571 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
commit 2df1173a251c0ea6d938cd200f3feaa4e5e8b7e5 1 parent a5d8749
Michael Sheets infininight authored
Showing with 125 additions and 4 deletions.
  1. +125 −4 Syntaxes/Textile.plist
129 Syntaxes/Textile.plist
View
@@ -255,16 +255,137 @@
<string>markup.list.numbered.textile</string>
</dict>
<dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>string.other.link.title</string>
+ </dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>string.other.link.description.title</string>
+ </dict>
+ <key>3</key>
+ <dict>
+ <key>name</key>
+ <string>constant.other.reference.link</string>
+ </dict>
+ </dict>
<key>match</key>
- <string>"(\\"|[^"])*":\S+</string>
+ <string>(?x)
+ " # Start name, etc
+ (?: # Attributes
+ # I swear, this is how the language is defined,
+ # couldnt make it up if I tried.
+ (?:\([^)]+\))?(?:\{[^}]+\})?(?:\[[^\]]+\])?
+ # Class, Style, Lang
+ | (?:\{[^}]+\})?(?:\[[^\]]+\])?(?:\([^)]+\))?
+ # Style, Lang, Class
+ | (?:\[[^\]]+\])?(?:\{[^}]+\})?(?:\([^)]+\))?
+ # Lang, Style, Class
+ )?
+ ([^"]+?) # Link name
+ \s? # Optional whitespace
+ (?:\(([^)]+?)\))?
+ ": # End name
+ (\w[-\w_]*) # Linkref
+ (?=[^\w\/;]*?(&lt;|\s|$)) # Catch closing punctuation
+ # and end of meta.link
+ </string>
<key>name</key>
- <string>markup.underline.link.textile</string>
+ <string>meta.link.reference.textile</string>
</dict>
<dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>string.other.link.title</string>
+ </dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>string.other.link.description.title</string>
+ </dict>
+ <key>3</key>
+ <dict>
+ <key>name</key>
+ <string>markup.underline.link</string>
+ </dict>
+ </dict>
+ <key>match</key>
+ <string>(?x)
+ " # Start name, etc
+ (?: # Attributes
+ # I swear, this is how the language is defined,
+ # couldnt make it up if I tried.
+ (?:\([^)]+\))?(?:\{[^}]+\})?(?:\[[^\]]+\])?
+ # Class, Style, Lang
+ | (?:\{[^}]+\})?(?:\[[^\]]+\])?(?:\([^)]+\))?
+ # Style, Lang, Class
+ | (?:\[[^\]]+\])?(?:\{[^}]+\})?(?:\([^)]+\))?
+ # Lang, Style, Class
+ )?
+ ([^"]+?) # Link name
+ \s? # Optional whitespace
+ (?:\(([^)]+?)\))?
+ ": # End Name
+ (\S*?(?:\w|\/|;)) # URL
+ (?=[^\w\/;]*?(&lt;|\s|$)) # Catch closing punctuation
+ # and end of meta.link
+ </string>
+ <key>name</key>
+ <string>meta.link.inline.textile</string>
+ </dict>
+ <dict>
+ <key>captures</key>
+ <dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>markup.underline.link.image</string>
+ </dict>
+ <key>3</key>
+ <dict>
+ <key>name</key>
+ <string>string.other.link.description</string>
+ </dict>
+ <key>4</key>
+ <dict>
+ <key>name</key>
+ <string>markup.underline.link</string>
+ </dict>
+ </dict>
<key>match</key>
- <string>!\S+(\((\w| )+\))?!</string>
+ <string>(?x)
+ \! # Open image
+ (\&lt;|\=|\&gt;)? # Optional alignment
+ (?: # Attributes
+ # I swear, this is how the language is defined,
+ # couldnt make it up if I tried.
+ (?:\([^)]+\))?(?:\{[^}]+\})?(?:\[[^\]]+\])?
+ # Class, Style, Lang
+ | (?:\{[^}]+\})?(?:\[[^\]]+\])?(?:\([^)]+\))?
+ # Style, Lang, Class
+ | (?:\[[^\]]+\])?(?:\{[^}]+\})?(?:\([^)]+\))?
+ # Lang, Style, Class
+ )?
+ (?:\.[ ])? # Optional
+ ([^\s(!]+?) # Image URL
+ \s? # Optional space
+ (?:\(((?:[^\(\)]|\([^\)]+\))+?)\))? # Optional title
+ \! # Close image
+ (?:
+ :
+ (\S*?(?:\w|\/|;)) # URL
+ (?=[^\w\/;]*?(&lt;|\s|$)) # Catch closing punctuation
+ )?
+ </string>
<key>name</key>
- <string>markup.underline.link.image.textile</string>
+ <string>meta.image.inline.textile</string>
</dict>
<dict>
<key>captures</key>
Please sign in to comment.
Something went wrong with that request. Please try again.