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

Nibaldo González noreply at phabricator.kde.org
Tue Feb 26 08:08:20 GMT 2019


nibags created this revision.
nibags added reviewers: Framework: Syntax Highlighting, cullmann, dhaumann.
Herald added projects: Kate, Frameworks.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
nibags requested review of this revision.

REVISION 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:**
  
  - [1] https://github.com/mustache/vim-mustache-handlebars
  - [2] https://github.com/atom/language-mustache
  - [3] https://handlebarsjs.com/
  - [4] https://stackoverflow.com/questions/5679220/how-does-html-tags-work-inside-script-tag

REPOSITORY
  R216 Syntax Highlighting

BRANCH
  update-mustache

REVISION DETAIL
  https://phabricator.kde.org/D19328

AFFECTED FILES
  autotests/folding/example.rmd.fold
  autotests/folding/highlight.php.fold
  autotests/folding/test.htm.fold
  autotests/folding/test.markdown.fold
  autotests/folding/test.mustache.fold
  autotests/html/highlight.php.html
  autotests/html/test.htm.html
  autotests/html/test.mustache.html
  autotests/input/test.htm
  autotests/input/test.mustache
  autotests/reference/highlight.php.ref
  autotests/reference/test.htm.ref
  autotests/reference/test.mustache.ref
  autotests/syntaxrepository_test.cpp
  data/CMakeLists.txt
  data/syntax/html.xml
  data/syntax/mustache-js.xml
  data/syntax/mustache.xml

To: nibags, #framework_syntax_highlighting, cullmann, dhaumann
Cc: kwrite-devel, kde-frameworks-devel, domson, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190226/a1f3172b/attachment.html>


More information about the Kde-frameworks-devel mailing list