Bug 319683 - reStructuredText syntax highlighting has problems with inline markup
Summary: reStructuredText syntax highlighting has problems with inline markup
Status: RESOLVED WORKSFORME
Alias: None
Product: kate
Classification: Applications
Component: syntax (other bugs)
Version First Reported In: 3.10.2
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2013-05-11 20:32 UTC by eseifert
Modified: 2018-10-27 02:40 UTC (History)
1 user (show)

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


Attachments
Patch to fix highlighting of some reStructuredText inline markup (1.39 KB, patch)
2013-05-11 20:36 UTC, eseifert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description eseifert 2013-05-11 20:32:38 UTC
The regular expressions used to match inline markup for reStructuredText syntax are greedy and fail to match multiple occurrences. Here are some examples of valid reST markup which get wrong highlighting:

This is *emphasized* text and more *emphasized* text.
This is **strongly emphasized** text and more **strongly emphasized** text.
This is a `interpreted text` and another `interpreted text`.
This is a ``inline literal`` and another ``inline literal``.
This is a `anonymous link <http://foo.org>`__ and another `anonymous link <http://bar.org>`__.


Reproducible: Always

Steps to Reproduce:
1. Open kate
2. Switch syntax highlighting mode to "reStructuredText"
3. Type multiple inline markers of the same type in one line, e.g. *emphasis1* and *emphasis2*
Actual Results:  
All text between the emphasized text of emnphasis is highlighted as if there was only one piece of marked text.

Expected Results:  
Each occurrence marked text should be highlighted, but the text between them shouldn't.

See http://docutils.sourceforge.net/docs/user/rst/quickref.html#inline-markup for more examples of inline markup.
Comment 1 eseifert 2013-05-11 20:36:45 UTC
Created attachment 79837 [details]
Patch to fix highlighting of some reStructuredText inline markup

Patch that changes reST syntax rules for inline markuo to use non-greedy regular expressions and improves highlighting of some link types.
Comment 2 Christoph Cullmann 2014-09-09 21:23:36 UTC
Could you take a look at the current state of restructuredtext? we have now a rest.xml for it, that is quiet different.
Comment 3 Andrew Crouthamel 2018-09-25 03:51:42 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Andrew Crouthamel 2018-10-27 02:40:58 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!