Menu

#1804 Markdown highlighting broken within parenthesis

Bug
open-accepted
nobody
5
2016-01-14
2016-01-13
Bewied
No

The following should be valid markup and read as intended:

What a nice (`num_deaths == 0`) day!

Expected behavior: the num_deaths == 0 part gets parsed as code.

Actual behavior: it doesn't.

This is definitely unrelated to #1766 [1], as can be seen by the code it touches (it only deals with linebreaks) and that the problem still occurs downstream [2], with the patch of #1766 already applied.

I assume that LexMarkdown.cxx will have to include a whitelist of characters after which markdown-markup still is allowed, such as various opening brackets ([{.

Regards,
Ben Wiederhake
[1] https://sourceforge.net/p/scintilla/bugs/1766/
[2] https://github.com/geany/geany/issues/867#issuecomment-171406900

Discussion

  • Neil Hodgson

    Neil Hodgson - 2016-01-13
    • status: open --> open-accepted
     
  • Kein-Hong Man

    Kein-Hong Man - 2016-01-14

    Here's the problem:

    LexMarkdown.cxx[384]:
    else if (sc.ch == '`' && sc.chNext != ' ' && AtTermStart(sc)) {

    AtTermStart() wants a whitespace before the backtick. I don't exactly understand why the author wanted to do that, but the comments in line 26 may be a clue. AtTermStart() certainly seems to be a poor solution to whatever glitch it was...

     

Log in to post a comment.