Bug 459972 - non breaking space prevent keywords highlighting in comments
Summary: non breaking space prevent keywords highlighting in comments
Status: RESOLVED FIXED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (other bugs)
Version First Reported In: 5.98.0
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-04 14:07 UTC by Xavier Brochard
Modified: 2022-10-18 07:27 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xavier Brochard 2022-10-04 14:07:13 UTC
Syntax highlighting doesn't work if a non-breaking space follow a keyword in comments. However, it works well if  a non-breaking space is before a keyword. Same behaviour in code. May be this is intentional for code, but in comments with keywords like TODO, FIXME and so on, I find this behaviour annoying.

Tested with Perl, Bash, Python and C.

To see sample cases in Perl, try this:

#! /usr/bin/perl
#
# highlighted:
#TODO
#[normal space]TODO
#[normal space]TODO[normal space]
#[non breaking space here]TODO
#[non breaking space here]TODO[normal space]
#
# not highlighted:
#TODO[non breaking space here]
#[normal space]TODO[non breaking space here]
Comment 1 Bug Janitor Service 2022-10-17 00:48:10 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/372
Comment 2 Christoph Cullmann 2022-10-17 18:33:07 UTC
Git commit 8fe3d8facf503f3bade421da6522c4b671980ba2 by Christoph Cullmann, on behalf of Jonathan Poelen.
Committed on 17/10/2022 at 17:11.
Pushed by cullmann into branch 'master'.

Alerts: add NO-BREAK SPACE (nbsp) as keyword deliminator

M  +3    -0    autotests/folding/test-alerts.fold
M  +3    -0    autotests/html/test-alerts.dark.html
M  +3    -0    autotests/html/test-alerts.html
M  +3    -0    autotests/input/test-alerts
M  +3    -0    autotests/reference/test-alerts.ref
M  +3    -2    data/syntax/alert.xml

https://invent.kde.org/frameworks/syntax-highlighting/commit/8fe3d8facf503f3bade421da6522c4b671980ba2
Comment 3 Xavier Brochard 2022-10-18 07:27:06 UTC
thanks !