-
Notifications
You must be signed in to change notification settings - Fork 202
Conversation
Neat, I'm using Liquid as well and wanted to look into this. Could you add a test for the white-space-controlling tags? E.g. |
Liquid explicitly can be used for other things than HTML, which is why
I personally am using Liquid in a completely different context, because it gives control about whitespace and thus is suited to render arbitrary text based content. I think this is a general question if templating languages should have both a |
@mattvague The reason some of these rules get repeated in Monarch is because Monarch does not support injections like for example Textmate does. @Prinzhorn I recommend that we merge this PR in and then that we tackle subsequent issues in separate issues/PRs. |
Thanks guys! |
Can def do that in a followup PR (can't promise when though).
Yeah I guess that's kind of what I was thinking: have the liquid lang on it's own, and then liquid-html, liquid-CSS, liquid-X. |
@alexdima I'm not 100% sure what injections in textmate do, but could we not accomplish what was laid out above with |
That works for certain cases, namely cases like JavaScript embedded inside HTML where each <script>//a comment that is not continued</script><h1>Hello</h1><script>const x = 3;</script> Notice how the Now, looking at something like php, this is no longer the case e.g.: <div class="<?php echo $myvar; ?> someother"></div> Notice how the HTML after In TextMate, this is handled by creating a new PHP grammar that consists of injecting a rule for |
Using the Handlebars language implementation as a base, added support for Shopify's Liquid templating language.
One thing I wanted to ask is: what are the current best practices for languages that can implemented inside other languages? From what I can see in Handlebars, Markdown, etc is that basically they had to re-implement support for HTML as I did. I was wondering though if it'd be possible to instead extend for example the HTML or CSS language implementations and then use
nextEmbedded
to add support for Liquid?Cheers! Looking forward to some feedback on my first contribution 😄