Bug 445918 - Markdown headings highlighted completely in purple rending text unreadable
Summary: Markdown headings highlighted completely in purple rending text unreadable
Status: RESOLVED FIXED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: theme (show other bugs)
Version: 5.88.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-22 13:14 UTC by janik
Modified: 2021-12-03 20:03 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
screenshot (2.15 KB, image/png)
2021-11-22 13:14 UTC, janik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description janik 2021-11-22 13:14:20 UTC
Created attachment 143834 [details]
screenshot

SUMMARY
When editing markdown, headings are highlighted in a way that renders the text unreadable. The whole box around the text is colored (in my theme purple).


STEPS TO REPRODUCE
1.  open .md file
2. create heading (# heading)
3. look at highlight

OBSERVED RESULT
everything colored but the last character. See attached Image 

EXPECTED RESULT
highlighted but still readable

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 21.08.03 on Arch Linux
(available in About System)
KDE Plasma Version: 5.23.3
KDE Frameworks Version: 5.88.0
Qt Version: 5.12.2

ADDITIONAL INFORMATION
Related https://bugs.kde.org/show_bug.cgi?id=444422
Comment 1 Jan Paul Batrina 2021-11-25 00:20:14 UTC
Confirmed with these steps:

1. open/create .md file
2. Insert the following text:

# heading
## heading

# heading 2

3. Place cursor on "# heading 2"

This is (unintentionally) caused by the folding region highlight introduced by https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/194. The fix would be to ensure that the Heading color(s) and the Bracket Highlight Color are not the same, at least for the default color schemes.
Comment 2 Bug Janitor Service 2021-11-28 12:11:55 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/277
Comment 3 Christoph Cullmann 2021-12-03 20:03:04 UTC
Git commit 6188135d40c8f62176c5762896d130cc0c95bd4e by Christoph Cullmann, on behalf of Jan Paul Batrina.
Committed on 03/12/2021 at 19:53.
Pushed by cullmann into branch 'master'.

markdown.xml: Fix highlighting of headers (include last char)

d277eb4134a2aab4d5981b605faa85b83ae4f552 introduced a hack
to close subheaders by using a header's last char as the
closing character for the subheader regions. This made the
last character always highlighted as an H6 header (which
was not visible with the Breeze themes since all headers
had the same color).

An invisible sentinel region is now used so that the header
regions won't be paired together, preventing erroneous
folding region highlights.
Related: bug 444422

M  +54   -54   autotests/folding/test.markdown.fold
M  +53   -53   autotests/html/test.markdown.dark.html
M  +53   -53   autotests/html/test.markdown.html
M  +53   -53   autotests/reference/test.markdown.ref
M  +23   -13   data/syntax/markdown.xml

https://invent.kde.org/frameworks/syntax-highlighting/commit/6188135d40c8f62176c5762896d130cc0c95bd4e