Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some sequence hangs the syntax highlighting #11

Open
pieroxy opened this issue May 13, 2017 · 7 comments
Open

Some sequence hangs the syntax highlighting #11

pieroxy opened this issue May 13, 2017 · 7 comments
Assignees
Labels

Comments

@pieroxy
Copy link

pieroxy commented May 13, 2017

Take the following example:

<script>
window.myVar=${myVar?c};
</script>

<#if myTest>
  <input type="text">
</#if>

<#if myTest>
</#if>

The second if statement has no syntax highlighting. Nor does most of the rest of the file. My original file is huge and almost half of it isn't highlighted. For some reason, at some point in the file, the highlighting returns.

Removing ?c makes it work. Removing the > in the first </#if makes it work. Removing the <input> makes it work. But as it is it doesn't work. I can't get my head around this one.

@dcortes92 dcortes92 self-assigned this May 13, 2017
@dcortes92 dcortes92 added the bug label May 13, 2017
@dcortes92
Copy link
Owner

Hi @pieroxy I went through all the syntax and I discovered that perhaps the missing self enclosing tag for the input, among other reasons, is causing the rest of the syntax to break.

It's still not clear for me why is this happening but I'm working on it. Please try with this snippet:

<script>
window.myVar = ${myVar?c};
</script>

<#if myTest>
  <input type="text" />
</#if>

<#if myTest>
</#if>

Notice I change the input tag from <input type="text" > to <input type="text" />.
I hope your template doesn't rely on any specific Doctype.

@aeroslav
Copy link

Hi @dcortes92 ! I have highlighting broken after </script> tag. Removing '?' sign returns normal colors. Here is the screenshot.

@dcortes92
Copy link
Owner

Hi @aeroslav thank you for your comment. Yes this is still an open bug. However, I was working on some workarounds you can use in the meantime. For your example I'd use the js_string built-in:

<script>
    window.myVar="${myVar?js_string}"
</script>

<#if myTest>
    <input type="text"/>
</#if>

I'm still trying to work a solution for this and #12 so please bear with me 😄 Hope this helps.

Daniel

@MrNagoo
Copy link

MrNagoo commented May 16, 2018

Hey I have a syntax highlight issue with square brackets in a style tag.

<style>
  []
</style>

has weird highlighting for the rest of the file.

@dcortes92
Copy link
Owner

Hi @MrNagoo yes I'm still trying to find a solution for this. Unfortunately I haven't got the time (yet) to fix this (sorry about that).

@dropddesigns
Copy link

I'm also experiencing an issue with the <style> tags in a Freemarker template, even without the square brackets

@dmstern
Copy link

dmstern commented Oct 9, 2019

Another example: square brackets inside a tag:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants