slim-template / ruby-slim.tmbundle

A Textmate / Sublime Text bundle for Slim
http://slim-lang.com/
MIT License
184 stars 46 forks source link

Better support for inline HTML tags #29

Closed agarzola closed 11 years ago

agarzola commented 11 years ago

Provides support for inline HTML tag syntax while excluding regular use of the colon character within text. Before these commits, something like p Lorem ipsum dolor: sit amet. would result in dolor: sit acquiring tag coloring. Not anymore.

Also, inline HTML tags may have attributes with values and tags will remain colored as one would expect as do attribute value strings.

Caveat: String coloring is a bit sketchy. Strings get tag coloring in certain situations, which is better than it was before. Inline HTML tags in Slim aren’t practical for long lists of tags with a bunch attributes each, anyway. The last tag in the line (along with its attributes and values) will color reliably, so the common use case:

ul
  li.first: a href="#about" title="About Us" target="_top" About Us
  li: a href="#contact" title="Contact Us" target="_top" Contact Us

should work like a charm.

EDIT: Also, added a commit to define a pattern for markdown, so that nested markdown doesn’t get Slim coloring.

fredwu commented 11 years ago

Very nice! Merged, thank you! :+1: :

agarzola commented 11 years ago

Sweet! Now if only I could figure out how to get markdown syntax coloring within slim templates, I'd be golden.