davidrios / jade-tmbundle

A comprehensive textmate / sublime text bundle for the Jade template language.
https://github.com/davidrios/jade-tmbundle
MIT License
102 stars 31 forks source link

support plaintext embedded jade in script type('text/templates') #28

Closed loklaan closed 10 years ago

loklaan commented 10 years ago

I thought I should put an issue up as my regex-fu isn't so good.

Writing embedded jade after script(type="text/template") requires writing that jade code with plaintext escapes, like end dot or piping. So, like this:

script(type='text/template').
  div#some Id
    input.someClass(type='text')
    button.coolButton(href='javascript:void()') Press me

or

script(type='text/template')
  |div#some Id
  |  input.someClass(type='text')
  |  button.coolButton(href='javascript:void()') Press me

Would be nice to ignore those initial escapes and continue using source.jade.

davidrios commented 10 years ago

If you want the contents of the script tag to be interpreted as jade don't use the trailing dot or pipe syntax, at least as of the latest jade version (1.3.1). Also I fixed it so it won't be highlighted as javascript.