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

Dominik Haumann <dhaum...@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CONFIRMED                   |RESOLVED
         Resolution|---                         |FIXED
      Latest Commit|                            |https://commits.kde.org/syn
                   |                            |tax-highlighting/c276c7003d
                   |                            |3569001b12e8095e896da88f134
                   |                            |13e

--- Comment #3 from Dominik Haumann <dhaum...@kde.org> ---
Git commit c276c7003d3569001b12e8095e896da88f13413e by Dominik Haumann, on
behalf of Nibaldo González.
Committed on 03/01/2019 at 19:35.
Pushed by dhaumann into branch 'master'.

WML: fix infinite loop in contexts switch & only highlight tags with valid
names

Summary:

In the `wml.xml` file an infinite context switch between `section` and `error`
is generated, through `lineEndContext`: in a line break, the `section` context
sends to `error` and then this is #poped in the line break, causing an infinite
cycle. This causes that Kate freezes.

This is reproducible by typing the `[` character and then a line break.

This bug is reproducible only in KSyntaxHighlighting, since in KF5.48 there is
no problem. It's probably necessary to add a guard that avoids infinite context
changes.

Also, the WML highlighter is a little old and I have seen some problems in
sample files. The highlighter considers all content between `[` and `]` as tag.
According to the documentation [1]:
```
Also, tag and key names follow a special format. They will contain only
alphanumeric characters and underscores; in particular, they will not contain
+, -, or whitespace.
```
Considering this, and based on the VSCode highlighter, I modified the code so
that only tags with valid names are highlighted.

**References:**
* [1] Wesnoth Wiki. SyntaxWML, Tag and Attribute Structures:
https://wiki.wesnoth.org/SyntaxWML#Tag_and_Attribute_Structures
* [2] Wesnoth Markup Language syntax highlightning for VS Code:
https://github.com/Byteron/wml ,
https://marketplace.visualstudio.com/items?itemName=Bitron.wml

Reviewers: #framework_syntax_highlighting, dhaumann, cullmann

Reviewed By: #framework_syntax_highlighting, dhaumann

Subscribers: kwrite-devel, kde-frameworks-devel

Tags: #kate, #frameworks

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

A  +101  -0    autotests/folding/test.pbl.fold
A  +108  -0    autotests/html/test.pbl.html
A  +101  -0    autotests/input/test.pbl
A  +101  -0    autotests/reference/test.pbl.ref
M  +14   -10   data/syntax/wml.xml

https://commits.kde.org/syntax-highlighting/c276c7003d3569001b12e8095e896da88f13413e

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

Reply via email to