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

Incorrect Comment syntax highlighting for block comments with string note #124

Closed
amerikan opened this issue Aug 3, 2020 · 4 comments
Closed

Comments

@amerikan
Copy link

amerikan commented Aug 3, 2020

Block comments allows for an optional string note. See https://docs.djangoproject.com/en/3.0/ref/templates/builtins/#comment

<p>Rendered text with {{ pub_date|date:"c" }}</p>
{% comment "Optional note" %}    <------------ EXAMPLE HERE
    <p>Commented out text with {{ create_date|date:"c" }}</p>
{% endcomment %}

Without a string note, the comment syntax highlighted appears a muted gray as expected.

Screen Shot 2020-08-03 at 4 13 06 PM

However, when a note is added it no longer appears as if it was a comment:

Screen Shot 2020-08-03 at 4 14 28 PM

Expected:
Should be also be a muted gray color.

Basically the following two formats should have grayed out appearance.

{% comment %} {% endcomment %}
{% comment "a string" %} {% endcomment %}

I'm not sure if this is by design and if I just have to change something in my settings.

@amerikan
Copy link
Author

amerikan commented Aug 3, 2020

Without looking too deep into the source code, my initial guess would be that we would need to add a regex here: https://github.com/squ1b3r/Djaneiro/blob/master/Syntaxes/HTML%20(Django).tmLanguage ?

@willstott101
Copy link

I've been meaning to get round to opening a PR for merging: https://github.com/willstott101/django-sublime-syntax

I'd think it'd be easier to fix this syntax error in the .sublime-syntax format which my repo there uses. The newer syntax also fixes: #102

@amerikan
Copy link
Author

@willstott101 that would be great. I think that's my only complaint about the package, other than that it works perfect for my use cases.

@scuml
Copy link
Contributor

scuml commented Sep 17, 2022

This has been resolved.

@squ1b3r squ1b3r closed this as completed Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants