markdownsyntax-highlightinggeany

How can I make Geany's Markdown syntax highlighting agree with indented code blocks?


Write the following in Geany

* Item 1
* My code block will go after this line break

    ```sql
    CREATE EVENT SESSION query_performance ON SERVER
    ADD EVENT sqlserver.sql_statement_completed(
```
* Item 3

and set the filetype to Markdown enter image description here

you will then notice that the syntax highlighting is correct.

enter image description here

Now, indent the last line by four spaces, as I believe is the proper way to indent a code block in markdown.

* Item 1
* My code block will go after this line break

    ```sql
    CREATE EVENT SESSION query_performance ON SERVER
    ADD EVENT sqlserver.sql_statement_completed(
    ```
* Item 3

and then the syntax highlighting becomes incorrect. The rest of the document becomes highlighted as if it is part of the code block.

enter image description here

My question are as follows:

  1. Is what I have done considered a correct way to indent a code block?
  2. How can I prevent Geany from producing this incorrect syntax highlighting?

Solution

  • This will be fixed in the upcoming version (1.39 or 2.0). Though there is no release date set yet.

    This was already reported in the Geany bug tracker at https://github.com/geany/geany/issues/2797 and it was fixed in the Scintilla library, reported at https://sourceforge.net/p/scintilla/bugs/2247.

    The current GIT master already has a newer Scintilla version with the fix included. You could install the current GIT version yourself, see https://www.geany.org/manual/current/index.html#source-compilation for details.