After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754934 - html lang definition: no highlighting of embedded code in headings
html lang definition: no highlighting of embedded code in headings
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-12 20:31 UTC by Tobias Schönberg
Modified: 2015-10-01 16:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot showing the correct highlighting of DTL between html-tags. (9.94 KB, image/png)
2015-09-12 20:31 UTC, Tobias Schönberg
  Details
Adding embedded-lang-hook context to headings-contexts (3.37 KB, patch)
2015-09-12 20:49 UTC, Tobias Schönberg
none Details | Review
html: adding embedded-lang-hook context to headings-contexts (3.41 KB, patch)
2015-10-01 16:02 UTC, Sébastien Wilmet
committed Details | Review

Description Tobias Schönberg 2015-09-12 20:31:50 UTC
Created attachment 311217 [details]
Screenshot showing the correct highlighting of DTL between html-tags.

Currently embedded code (e.g. Django-template-language) between <title> and <h1> (<h2>, ...) tags is not highlighted. That is because in the <context id="headings"> block no <context ref="embedded-lang-hook"/> line is included. This affects all language definitions that are embedded in html and inherit styles from the html.lang file.

This is especially problematic in Django-template language because it uses this embedded code to customize the page title and the headings.

The attachment shows the situation with a patch already applied, so the brackets are already highlighted correctly. Without the patch the "{{" and "}}" brackets show up grey and the reader is under the impression that the section is interpreted as pure text.

I have a patch ready and will attach it next.
Comment 1 Tobias Schönberg 2015-09-12 20:49:47 UTC
Created attachment 311218 [details] [review]
Adding embedded-lang-hook context to headings-contexts

Languages embedded im html, whos highlighting is inherited from html.lang
are not hightlighted between the headings-contexts (<title>, <h1>, ...).
This prevents the reader to properly recognize code that is used to
customize the title or headings. For example the Django Template Language
is often used between the <title> tags to customize the title. If the
'{{' and '}}' brackets are not highlighted the reader interprets the
section as text instead of the embedded language. The patch adds the
<context ref="embedded-lang-hook"/> to the headings-contexts to fix this.

Fixes: 754934
Comment 2 Sébastien Wilmet 2015-10-01 16:02:37 UTC
The following fix has been pushed:
commit 932f9cb html: adding embedded-lang-hook context to headings-contexts
Comment 3 Sébastien Wilmet 2015-10-01 16:02:43 UTC
Created attachment 312503 [details] [review]
html: adding embedded-lang-hook context to headings-contexts

Languages embedded im html, whos highlighting is inherited from html.lang
are not hightlighted between the headings-contexts (<title>, <h1>, ...).
This prevents the reader to properly recognize code that is used to
customize the title or headings. For example the Django Template Language
is often used between the <title> tags to customize the title. If the
'{{' and '}}' brackets are not highlighted the reader interprets the
section as text instead of the embedded language. The patch adds the
<context ref="embedded-lang-hook"/> to the headings-contexts to fix this.
Comment 4 Sébastien Wilmet 2015-10-01 16:03:58 UTC
I've added the bug URL at the end of the commit message, and added "html" in the title.

Thanks!