GNOME Bugzilla – Bug 754934
html lang definition: no highlighting of embedded code in headings
Last modified: 2015-10-01 16:03:58 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.
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
The following fix has been pushed: commit 932f9cb html: adding embedded-lang-hook context to headings-contexts
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.
I've added the bug URL at the end of the commit message, and added "html" in the title. Thanks!