Bug 2120679 - gsv3 syntax highlighting breaks with the pcre2 transition
Summary: gsv3 syntax highlighting breaks with the pcre2 transition
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gtksourceview3
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Matthias Clasen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-23 14:09 UTC by Lyes Saadi
Modified: 2022-09-23 04:39 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-23 04:39:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Lyes Saadi 2022-08-23 14:09:47 UTC
Note: this also happens with gsv4, but, here, I am only concerned with gsv3 which is no longer maintained, and will then probably not be fixed upstream.

Description of problem:
I am the packager of notekit which depends on gtksourceviewmm3, and thus gtksourceview3. A port to gsv4 is impossible due to the unavailability of the mm bindings for gsv4.

We noticed that the recent glib2 move to pcre2 broke notekit entirely on f37/rawhide (it relies on gsv3 to do Markdown formatting and syntax highlighting), and disabling syntax highlighting solves Markdown formatting (as it is not broken by the pcre2 change), but leaves us without syntax highlighting, a relatively important part of the software.

The regex issues will probably be fixed in gsv4, so I'm asking if it would be possible to backport these to gsv3?

The files which seems to need patching are asp.lang, html.lang and css.lang.

Version-Release number of selected component (if applicable):
~ 
❯ rpm -q gtksourceview3
gtksourceview3-3.24.11-8.fc37.x86_64

~ 
❯ rpm -q gtksourceviewmm3
gtksourceviewmm3-3.18.0-15.fc37.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Open NoteKit
2. No Markdown formatting
3. Disable syntax highlighting and restarting NoteKit
4. Markdown formatting is back, but no syntax highlighting

Actual results:
```
(notekit:307145): GtkSourceView-WARNING **: 14:09:18.135: Failed to load '/usr/share/notekit/sourceview/markdown.lang': In file '/tmp/notekit.gsv/markdownlisting.lang' referenced from '/usr/share/notekit/sourceview/markdown.lang': In file '/usr/share/gtksourceview-3.0/language-specs/asp.lang' referenced from '/usr/share/notekit/sourceview/markdown.lang': In file '/usr/share/gtksourceview-3.0/language-specs/html.lang' referenced from '/usr/share/notekit/sourceview/markdown.lang': In file '/usr/share/gtksourceview-3.0/language-specs/css.lang' referenced from '/usr/share/notekit/sourceview/markdown.lang': Error while compiling regular expression (?i-x)(?:(?ix)
      (?:
        (?:
          -- |
          -? (?:(?ix)
      (?:
        [a-z_] |
        (?:(?i-x)[\x{80}-\x{10ffff}]) |
        (?:(?ix)
      (?:
        \\                   # backslash
        (?:
          [^\n\r\f0-9a-f] |  # not newline or hex digit; or
          [0-9a-f]{1,6} \s?  # 1-6 hex digits, trailing whitespace (not necessary in some cases)
        )
      )
    
)
      )
    
)
        )
        (?:(?ix)
      (?>
        (?:
          [a-z0-9_-]+ |
          (?:(?i-x)[\x{80}-\x{10ffff}])+ |
          (?:(?ix)
      (?:
        \\                   # backslash
        (?:
          [^\n\r\f0-9a-f] |  # not newline or hex digit; or
          [0-9a-f]{1,6} \s?  # 1-6 hex digits, trailing whitespace (not necessary in some cases)
        )
      )
    
)+
        )+
      )
    
)?
      )
    
) at char 127: plage déclassée dans la classe de caractère
```

Expected results:
It works.

Additional info:
The same issues are encountered in gsv4.

Comment 1 Lyes Saadi 2022-08-23 16:18:07 UTC
A NoteKit contributor tested all syntax highlighting and composed a list of broken specs:

- css
- "GDB log"
- groovy (gradle)
- html (asp.net, dtl, erb-html, markdown, media-wiki, tera)
- jsdoc (erb-js, javascript, json, jsx, Objective-J, typescript, typescript-jsx)
- less
- php
- python3
- scss

Comment 2 Lyes Saadi 2022-09-23 04:39:44 UTC
Solved in glib directly


Note You need to log in before you can comment on or make changes to this bug.