| Summary: | incorrect YAML highlighted some text block | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-syntax-highlighting | Reporter: | Alexandr Zamaraev (aka Tonal) <tonal.promsoft> |
| Component: | syntax | Assignee: | Nibaldo G. <nibgonz> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | aspotashev, nibgonz |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://commits.kde.org/syntax-highlighting/28b11e39fba077fc1b41e27ee31439a331fd066e | Version Fixed/Implemented In: | 5.59.0 |
| Sentry Crash Report: | |||
Comment spec: https://yaml.org/spec/1.2/spec.html#id2780069 Proposed patch: https://phabricator.kde.org/D21411 Git commit 28b11e39fba077fc1b41e27ee31439a331fd066e by Nibaldo González.
Committed on 31/05/2019 at 18:58.
Pushed by ngonzalez into branch 'master'.
YAML: only comments after spaces and other improvements/fixes
Summary:
FIXED-IN: 5.59.0
Improvements and corrections to YAML.
**Changes:**
* Only highlight comments after spaces.
* Add folding indentation, like the Python highlighter.
* Avoid highlighting lists, hashes and strings within blocks with multiple lines, incorrectly.
* Highlight two points of Keys in another color, to make it easier to differentiate Keys and attributes in some color schemes.
* Changes in colors:
* The Keys are now in bold, helps to differentiate Keys and attributes, especially in the Solarized schemes.
* Data types are highlighted with `dsOthers`, to differentiate from the Attribute color.
* "Normal Text" is now `dsAttribute`, to unify the colors of attributes, since in attributes with multiple lines the colors are inconsistent. This is done according to other text editors such as VSCode and Atom, where the same color is used for attributes and normal text.
{F6849805}
{F6849807}
Solarized scheme:
{F6849808}
Normal block & literal block:
{F6849809}
Reviewers: dhaumann, cullmann, #framework_syntax_highlighting
Reviewed By: dhaumann, cullmann, #framework_syntax_highlighting
Subscribers: kwrite-devel, kde-frameworks-devel
Tags: #kate, #frameworks
Differential Revision: https://phabricator.kde.org/D21411
M +34 -28 autotests/folding/test.yaml.fold
M +4 -4 autotests/html/example.rmd.html
M +98 -92 autotests/html/test.yaml.html
M +6 -0 autotests/input/test.yaml
M +4 -4 autotests/reference/example.rmd.ref
M +89 -83 autotests/reference/test.yaml.ref
M +190 -127 data/syntax/yaml.xml
https://commits.kde.org/syntax-highlighting/28b11e39fba077fc1b41e27ee31439a331fd066e
|
SUMMARY Incorrect highlighted text as comment Break highlighting in double quote inside text block STEPS TO REPRODUCE 1. Paste this fragment to Kate: <yaml> 7: domain: example.org reg_list: - reg: ?#XPath //div[@class="product_item cf"][@id] ))(?sx) id="product(?P<code>[^"]+)" .+?<h4><a\s+[^>]+>(?P<title>[^<]+)</a></h4> .+?>(?:(?P<artikul>[^<]+)|\s*)</span> .+?(?:new|usual)Price">(?:(?P<price>[\d\s,.]*\d)(?:<span\s+ class="(?P<rub>rur)">)?|<span[^>]*>по\s+ запросу) - reg: ?#XPath //div[@class="product_item cf"][not(@id)] ))(?sx) <h4>\s*<a\s+href=[^>]+>(?P<title>[^<]+)</a></h4> .+?<div\s+ class="divRow"\s+ id="rowOffer(?P<code>\d+)"> .+?<span\s+ class="nameForOffer">(?:(?P<artikul>[^<]+)|\s*)</span> .+?(?:new|usual)Price">\s*(?:(?P<price>[\d\s,.]+\d)\s*<span\s+class="(?P<rub>rur)">|<span\s+[^>]+>\s*по\s+ запросу) - reg: ?#XPath //div[@class="second_column left"] ))"name"\scontent="(?P<title>[^<]+)">[\s\S]+?Артикул:\s<span>(?P<artikul>[^<]+)</span>[\s\S]+?Price">(?P<price>[\d\s,.]+)[\s\S]+?id="spinner(?P<code>[^"]+)" </yaml> OBSERVED RESULT Incorrect highlighted comment after '?' Break highlighting in double quote inside text block EXPECTED RESULT 3 key "reg". Values - text block without comments. SOFTWARE/OS VERSIONS Operating System: KDE neon 5.15 KDE Plasma Version: 5.15.4 KDE Frameworks Version: 5.57.0 Qt Version: 5.12.0 Kernel Version: 4.15.0-48-generic OS Type: 64-bit Processors: 4 × Intel® Core™ i5-6200U CPU @ 2.30GHz Memory: 19,5 ГиБ