https://bugs.kde.org/show_bug.cgi?id=369562

Christoph Cullmann <cullm...@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|REPORTED                    |RESOLVED
      Latest Commit|                            |https://commits.kde.org/syn
                   |                            |tax-highlighting/33ad9cdec8
                   |                            |24f3ac7dc0086149a28f4f0e097
                   |                            |a14

--- Comment #1 from Christoph Cullmann <cullm...@kde.org> ---
Git commit 33ad9cdec824f3ac7dc0086149a28f4f0e097a14 by Christoph Cullmann, on
behalf of Nibaldo González.
Committed on 12/02/2019 at 19:43.
Pushed by cullmann into branch 'master'.

HTML: highlight JSX, TypeScript & MustacheJS code in the <script> tag

Summary:
In the `<script>` tag, it will be possible to highlight JSX, TypeScript and
Mustache (MustacheJS/HandlebarsJS/RactiveJS) code, according to the "type"
attribute.

For example, in `<script type="text/typescript">`, TypeScript code will be
highlighted; in `<script type="text/babel">` JavaScript React will be
highlighted. These highlights are activated when using the following values in
the "type" attribute:

**JSX (JavaScript React):**
* text/jsx
* text/babel

**TypeScript:**
* text/typescript

**MustacheJS/HandlebarsJS/RactiveJS:**
* x-tmpl-mustache
* text/x-mustache-template
* text/x-handlebars-template
* text/ractive

By default, JavaScript highlighting is used.

The absence of highlighting for Mustache templates in HTML is mentioned in the
bug #369562. I have created a new hidden language file that adds Mustache
variables to JavaScript. [1][2]

Also, I made some modifications to the **data/generators/generate-php.pl**
script:
* Avoid duplicate attribute "hidden" in the "language" tag.
* Avoid injecting `<IncludeRules context="FindPHP" />` after `<context ... />`
(replace `/>` with `><IncludeRules context="FindPHP" /></context>`).

**References:**
* [1] Mustache.js: https://github.com/janl/mustache.js
* [2] Mustache package for Atom: https://github.com/atom/language-mustache

Reviewers: #framework_syntax_highlighting, dhaumann, cullmann

Reviewed By: #framework_syntax_highlighting, cullmann

Subscribers: kwrite-devel, kde-frameworks-devel

Tags: #kate, #frameworks

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

M  +46   -0    autotests/folding/test.htm.fold
M  +1    -1    autotests/folding/test.markdown.fold
M  +46   -0    autotests/html/test.htm.html
M  +46   -0    autotests/input/test.htm
M  +46   -0    autotests/reference/test.htm.ref
M  +6    -0    data/CMakeLists.txt
M  +10   -2    data/generators/generate-php.pl
M  +65   -3    data/syntax/html.xml
A  +326  -0    data/syntax/mustache-js.xml

https://commits.kde.org/syntax-highlighting/33ad9cdec824f3ac7dc0086149a28f4f0e097a14

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to