Hi,
As reported in Debian's bug #590284 [1] the Scintilla Markdown lexer has a bug that causes an infinite loop on certain circumstances.
In facts, it happens when HasPrevLineContent() is called on the second line and the first line is empty, because of a negative index error. Joined a patch that fixes the issue (and also fixes highlighting if the first title is one-character only). Joined is a patch that fixes the issue [2]
I haven't reported the bug to Scintilla yet, even if it seems to still be present in current Mercurial version, because I can't find out how to use the Markdown lexer with SciTE, so I can't test; but I also attach the slightly-tuned patch for Scintilla [3] (it's exactly the same except for a trailing whitespace that is in the Geany's Scintilla copy but not upstream). If anyone can test and/or tell me how to do, it'd be cool :)
Best regards, Colomban
[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=590284 [2] 0001-geany-scintilla-lexer-markdown-fix-infinite-loop.patch [3] 0001-scintilla-lexer-markdown-fix-infinite-loop.patch
On Sat, 14 Aug 2010 19:25:43 +0200, Colomban wrote:
Hi,
As reported in Debian's bug #590284 [1] the Scintilla Markdown lexer has a bug that causes an infinite loop on certain circumstances.
In facts, it happens when HasPrevLineContent() is called on the second line and the first line is empty, because of a negative index error. Joined a patch that fixes the issue (and also fixes highlighting if the first title is one-character only). Joined is a patch that fixes the issue [2]
Cool, thanks.
I haven't reported the bug to Scintilla yet, even if it seems to still be present in current Mercurial version, because I can't find out how to use the Markdown lexer with SciTE, so I can't test; but I also attach the slightly-tuned patch for Scintilla [3] (it's exactly the same except for a trailing whitespace that is in the Geany's Scintilla copy but not upstream). If anyone can test and/or tell me how to do, it'd be cool :)
It took me some time to figure out how it works but you can add Markdown as filetype by placing the attached markdown.properties file into Scite's datadir ($prefix/share/scite) and edit SciTEGlobal.properties, there are several places where you need to add it, I just searched for YAML and replaced it with markdown :).
Regards, Enrico
Le 15/08/2010 14:32, Enrico Tröger a écrit :
On Sat, 14 Aug 2010 19:25:43 +0200, Colomban wrote:
I haven't reported the bug to Scintilla yet, even if it seems to still be present in current Mercurial version, because I can't find out how to use the Markdown lexer with SciTE, so I can't test; but I also attach the slightly-tuned patch for Scintilla [3] (it's exactly the same except for a trailing whitespace that is in the Geany's Scintilla copy but not upstream). If anyone can test and/or tell me how to do, it'd be cool :)
It took me some time to figure out how it works but you can add Markdown as filetype by placing the attached markdown.properties file into Scite's datadir ($prefix/share/scite) and edit SciTEGlobal.properties, there are several places where you need to add it, I just searched for YAML and replaced it with markdown :).
Thank you! I tried to do the same yesterday, but I probably missed something... anyway, the bug applies too, and I opened the corresponding bug report on Scintilla's tracker [1].
Regards, Colomban
[1] https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3045386...
On Sat, 14 Aug 2010 19:25:43 +0200 Colomban Wendling lists.ban@herbesfolles.org wrote:
As reported in Debian's bug #590284 [1] the Scintilla Markdown lexer has a bug that causes an infinite loop on certain circumstances.
In facts, it happens when HasPrevLineContent() is called on the second line and the first line is empty, because of a negative index error. Joined a patch that fixes the issue (and also fixes highlighting if the first title is one-character only). Joined is a patch that fixes the issue [2]
Thanks, applied to trunk. I think we should include this in the 0.19.1 release as well.
Regards, Nick