I use an XHTML template language for my web applications that allows me to define my own tags such as <s:embed>...</s:embed>. I set the language for these files to HTML so that embedded stylesheets, scripts, etc. are formatted correctly.
With HTML bundle update yesterday, these custom tags are now highlighted as errors with the scope invalid.illegal.unrecognized-tag.html
This has worked great for me for at least the last eight years at least. This new behavior is rather annoying.
Is there a way that I can avoid the HTML bundle flagging these custom tags as errors?
But they _are_ errors. <s> would be okay, and in HTML 5 <s data-embed="true"> would be okay, but <s:embed> is a malformed tag.
m.
On Jul 24, 2018, at 10:17 AM, Curt Sellmer sellmerfud@gmail.com wrote:
I use an XHTML template language for my web applications that allows me to define my own tags such as <s:embed>...</s:embed>. I set the language for these files to HTML so that embedded stylesheets, scripts, etc. are formatted correctly.
With HTML bundle update yesterday, these custom tags are now highlighted as errors with the scope invalid.illegal.unrecognized-tag.html
This has worked great for me for at least the last eight years at least. This new behavior is rather annoying.
-- matt neuburg, phd = http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 11! http://shop.oreilly.com/product/0636920107408.do iOS 11 Fundamentals! http://shop.oreilly.com/product/0636920107415.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
On Jul 24, 2018, at 12:17 PM, Curt Sellmer sellmerfud@gmail.com wrote:
I use an XHTML template language for my web applications that allows me to define my own tags such as <s:embed>...</s:embed>. I set the language for these files to HTML so that embedded stylesheets, scripts, etc. are formatted correctly.
With HTML bundle update yesterday, these custom tags are now highlighted as errors with the scope invalid.illegal.unrecognized-tag.html
This has worked great for me for at least the last eight years at least. This new behavior is rather annoying.
Is there a way that I can avoid the HTML bundle flagging these custom tags as errors?
So when I was redoing the grammar I did not do anything for XHTML compatibility. It should mostly work, but my plan for XHTML is to either let it use the XML grammar or a variant of it specific for XHTML. Because of the differences between the standard HTML and XHTML I think this is the best solution. But I don’t have a good grasp on what the common use case for XHTML is these days, it may solely be template cases such as in your case.
This said your case is different because you are talking about using a template system. The HTML grammar nor a potential XHTML grammar won’t be designed to support template tags. For template languages you will need a specific grammar to properly match and recognize the tags. Can you post a link to the template system you are using and your general usage of XHTML in general so I can get a feel of it? (If you don’t want to post it publicly you can email me at support.)
I am using a homegrown template system that I developed for Scala based framework. So there is no link to point you toward. If the HTML grammar would simply allow tag snames that begin with a prefix followed by a colon that would be sufficient.
I see that there are rules in the grammar with the scope names 'meta.tag.custom.start.html' and 'meta.tag.custom.end.html' Could those rules be modified to include these types of tag names without causing problems elsewhere? If so, I think that would do the trick.
On Tue, Jul 24, 2018 at 10:40 PM Michael Sheets mummer@whitefalls.org wrote:
On Jul 24, 2018, at 12:17 PM, Curt Sellmer sellmerfud@gmail.com wrote:
I use an XHTML template language for my web applications that allows me
to define my own tags such as <s:embed>...</s:embed>. I set the language for these files to HTML so that embedded stylesheets, scripts, etc. are formatted correctly.
With HTML bundle update yesterday, these custom tags are now highlighted
as errors with the scope invalid.illegal.unrecognized-tag.html
This has worked great for me for at least the last eight years at
least. This new behavior is rather annoying.
Is there a way that I can avoid the HTML bundle flagging these custom
tags as errors?
So when I was redoing the grammar I did not do anything for XHTML compatibility. It should mostly work, but my plan for XHTML is to either let it use the XML grammar or a variant of it specific for XHTML. Because of the differences between the standard HTML and XHTML I think this is the best solution. But I don’t have a good grasp on what the common use case for XHTML is these days, it may solely be template cases such as in your case.
This said your case is different because you are talking about using a template system. The HTML grammar nor a potential XHTML grammar won’t be designed to support template tags. For template languages you will need a specific grammar to properly match and recognize the tags. Can you post a link to the template system you are using and your general usage of XHTML in general so I can get a feel of it? (If you don’t want to post it publicly you can email me at support.)
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 25 Jul 2018, at 05:49, Curt Sellmer sellmerfud@gmail.com wrote:
I am using a homegrown template system that I developed for Scala based framework. So there is no link to point you toward. If the HTML grammar would simply allow tag snames that begin with a prefix followed by a colon that would be sufficient.
I see that there are rules in the grammar with the scope names 'meta.tag.custom.start.html' and 'meta.tag.custom.end.html' Could those rules be modified to include these types of tag names without causing problems elsewhere? If so, I think that would do the trick.
You can create a new grammar that inherits from the HTML grammar and makes your custom changes. Have a look at the C++ grammar which includes the C grammar.
-- /Jacob Carlborg
On Thu, Jul 26, 2018 at 1:32 PM Jacob Carlborg doob@me.com wrote:
You can create a new grammar that inherits from the HTML grammar and makes your custom changes. Have a look at the C++ grammar which includes the C grammar.
Thanks for the tip. I had made a local modification of the HTML bundle, but this is a much cleaner implementation.
On Jul 24, 2018, at 10:49 PM, Curt Sellmer sellmerfud@gmail.com wrote:
I am using a homegrown template system that I developed for Scala based framework. So there is no link to point you toward. If the HTML grammar would simply allow tag snames that begin with a prefix followed by a colon that would be sufficient.
I see that there are rules in the grammar with the scope names 'meta.tag.custom.start.html' and 'meta.tag.custom.end.html' Could those rules be modified to include these types of tag names without causing problems elsewhere? If so, I think that would do the trick.
Originally took this off-list but bring back to the list with a sample grammar which implements a quick version of this:
https://gist.github.com/infininight/b03b1354ae402f6170814af88efed26f
(In the format you get in the bundle editor, to use create a personal bundle then a new language and paste in the contents.)
This will probably need some fiddling one some areas to get right, especially in the ${} section as I wasn’t sure what was in there. But this should be a good start to work from and might help anyone else needing something similar.