sublimetext-cfml icon indicating copy to clipboard operation
sublimetext-cfml copied to clipboard

No syntax highlighting for CSS or JavaScript in cfoutput block

Open KamasamaK opened this issue 7 years ago • 1 comments

A <cfoutput> block within a <script> or <style> block loses syntax highlighting.

Example: sublimetext-syntax-javascript-cfoutput

KamasamaK avatar Jan 06 '18 20:01 KamasamaK

Thanks @KamasamaK, I have been waiting for someone to raise this issue since I first put the package up 😀 . Perhaps I should have put it into a known issues section.

This is a (side) effect of the way I chose to implement the <cfoutput> tag. I wanted to distinguish between # characters inside and outside of <cfoutput> blocks, but the side effect of this is that inside of <cfoutput> blocks the scoping context goes back to the base HTML context. This works in most cases (for me, at least) and I decided I would live with this issue in order to retain the ability to distinguish # uses inside and outside of <cfoutput>.

In the past I would have just left it here, as I think the only solution for improving it is a custom HTML syntax that I would have to include in the package. I was not eager to maintain my own version of the HTML syntax. But it might be a lot easier to do that now, by using @Thom1729's YAML-Macros package to extend the base HTML syntax without having to create or maintain an entire syntax file. I am already using his package to build a separate CFScript syntax for when script is used in <cfset> tags and the like. I will take a look at that when I have some time.

jcberquist avatar Jan 06 '18 21:01 jcberquist