MustacheJS: also highlight template files, fix syntax and improve support for Handlebars
ClosedPublic

Authored by nibags on Feb 26 2019, 8:08 AM.

Details

Summary

The Mustache highlighting has been modified, so as to also highlight template files and make it more complete (previously, this highlighter was only used within HTML highlighting, in the <script> tag).
I have taken as reference the Mustache highlight files for Vim [1] and Atom [2], and the documentation of Musatche and Handlebars.

Changes:

  • Fix and simplify code: within <script>, in normal HTML files, it's not necessary to highlight JavaScript code, so that part is removed.
  • Highlight full HTML files, such as Mustache templates. That is, the highlighter is now not hidden, but it's applied to Mustache/Handlebars/Ractive template files.
  • Rename: MustacheJS -> Mustache/Handlebars (HTML)
  • Improve support for Handlebars [3].
  • In 'html.xml', also highlight HTML templates in the <script> tags (with type="text/html") [4].

Sources:

Diff Detail

Repository
R216 Syntax Highlighting
Branch
update-mustache
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 8856
Build 8874: arc lint + arc unit
nibags created this revision.Feb 26 2019, 8:08 AM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptFeb 26 2019, 8:08 AM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
nibags requested review of this revision.Feb 26 2019, 8:08 AM
cullmann accepted this revision.Feb 26 2019, 10:41 PM

No objections from my side.
Thanks.

This revision is now accepted and ready to land.Feb 26 2019, 10:41 PM
nibags closed this revision.Feb 27 2019, 6:35 AM