Bug 487636 - Syntax highlighting not working on non ASCII characters (most specifically french)
Summary: Syntax highlighting not working on non ASCII characters (most specifically fr...
Status: RESOLVED FIXED
Alias: None
Product: ghostwriter
Classification: Applications
Component: general (show other bugs)
Version: 23.08.5
Platform: NixOS Linux
: NOR minor
Target Milestone: ---
Assignee: megan.conkle
URL:
Keywords:
: 476853 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-05-27 17:01 UTC by julien.lejoly2712
Modified: 2024-07-07 01:39 UTC (History)
1 user (show)

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


Attachments
A screenshot of the bug described above (8.55 KB, image/png)
2024-05-27 17:01 UTC, julien.lejoly2712
Details

Note You need to log in before you can comment on or make changes to this bug.
Description julien.lejoly2712 2024-05-27 17:01:05 UTC
Created attachment 169880 [details]
A screenshot of the bug described above

I'm writing a Markdown document in French, but the syntax highlighting such as marking as italic or bold doesn't work when it involves characters such as "é" or "è" at the beginning or end of sequence.

STEPS TO REPRODUCE
1. Open a new Ghostwriter Markdown document
2. Write the following content in it: 

- **Hello World**
- **Héllo World**
- **éllo world**
- **Hello worldé**

OBSERVED RESULT

The first two lines are rendered properly, but the last two (when there is a "é" character at beginning or end) aren't. I've attached a screenshot of the result to this report.

EXPECTED RESULT

I would have expected the syntax highlighting to behave the same way as it would do for ASCII characters.

SOFTWARE/OS VERSIONS
Ghostwriter version is 23.08.5 because I wasn't able to install a more recent version of it. I am sorry for the inconvenience, if this bug has been fixed in a later version. 

ADDITIONAL INFORMATION
Comment 1 megan.conkle 2024-07-07 01:09:21 UTC
*** Bug 476853 has been marked as a duplicate of this bug. ***
Comment 2 megan.conkle 2024-07-07 01:39:44 UTC
Git commit ce0ff54cd800db0acc75e496f8789fea72f22ba5 by Megan Conkle.
Committed on 07/07/2024 at 01:38.
Pushed by wereturtle into branch 'master'.

Fix syntax highlighting with unicode characters

Applied yet another hacky fix to the syntax highlighting issue that keeps
cropping up with various combinations of unicode characters. Cross your fingers!

Also noticed a few other bugs happened to be fixed either by this change
or by previous refactoring during the port to Qt6.
Related: bug 482078, bug 475234, bug 485691

M  +5    -1    .gitignore
M  +3    -0    CHANGELOG.md
M  +2    -7    src/editor/markdowneditor.cpp
M  +70   -6    src/editor/markdownhighlighter.cpp
M  +3    -6    src/markdown/cmarkgfmapi.cpp
M  +2    -2    src/markdown/markdownnode.cpp
M  +15   -6    src/markdown/markdownnode.h
A  +604  -0    widgets.qss

https://invent.kde.org/office/ghostwriter/-/commit/ce0ff54cd800db0acc75e496f8789fea72f22ba5