Menu

#2235 Markdown syntax highlighting confused by empty image title

Bug
closed-fixed
nobody
5
2021-06-02
2021-03-04
R. Polach
No

This problem is seen in Geany 1.36 on Windows 10 (using GTK+ v2.24.32 and GLib
v2.60.6 runtime libraries).

Markdown syntax highlighting is confused, when image link without title is used:

  ![](media\image21.png)

All the following text is highlighted bold (same as the link itself).
Also the following markdown syntax is ignored - see *Obecné* is not in italics.

When I fill in some title to image link

  ![abc](media\image21.png)

then the highlighting became correct (i.e. only link itself is bold).
Also the following markdown syntax is ok then (*Obecné* is in italics).

The correct behavior is to highlight bold only the link even if its title is empty.

2 Attachments

Discussion

  • Neil Hodgson

    Neil Hodgson - 2021-03-04
    • labels: --> lexilla, lexer, markdown
    • status: open --> open-accepted
     
  • rdipardo

    rdipardo - 2021-04-29

    I can confirm this also affects empty brackets in either the text or href portion of links.

    For example, if the href is assigned a label that exactly matches the text, the former can be left out (as demonstrated here: https://cm-gitlab.stanford.edu/help/markdown/markdown#links).

    The shorthand style is idiomatic and commonly used, but it makes the link style spill over to the adjacent text:

    Bug2235-repro-md

    I've submitted a patch addressing both the above and the originally reported issue.

     

    Last edit: rdipardo 2021-04-29
  • Neil Hodgson

    Neil Hodgson - 2021-04-30
    • status: open-accepted --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2021-04-30

    Committed as
    https://github.com/ScintillaOrg/lexilla/commit/feb225e72d094531f1bf9148646cd0a177f75200

    Thanks for including examples.

    Subsequently, I added an example of all Markdown styles as a test with some further changes caused by Windows versus Unix line ends.

     
  • Neil Hodgson

    Neil Hodgson - 2021-06-02
    • status: open-fixed --> closed-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2021-06-02

    Committed as
    https://github.com/ScintillaOrg/lexilla/commit/feb225e72d094531f1bf9148646cd0a177f75200

    Thanks for including examples.

    Subsequently, I added an example of all Markdown styles as a test with some further changes caused by Windows versus Unix line ends.

     

Log in to post a comment.

MongoDB Logo MongoDB