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

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

Description

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

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:

Reviewers: Framework: Syntax Highlighting, cullmann, dhaumann

Reviewed By: Framework: Syntax Highlighting, cullmann

Subscribers: kwrite-devel, kde-frameworks-devel

Tags: Kate, Frameworks

Differential Revision: https://phabricator.kde.org/D19328