Page 1 of 1

Tab-indented code block rendering issue

Posted: 02.10.2025 02:45
by katwalk
I’m using the Markdown lexer and seeing flaky rendering for tab-indented code blocks.

Take a look at this screen recording. As I type, the code block highlighting randomly drops out.
https://streamable.com/pv4t27

My questions:
Is this a lexer bug?
If not, the trigger rules for tab-indented code blocks are really confusing.

Re: Tab-indented code block rendering issue

Posted: 02.10.2025 06:23
by main Alexey
it has the reason.

a. regex for 'codeblock' rule is

Code: Select all

      DisplayName = 'Codeblock indented'
      Expression = '(?<=^$\n)(^(\x20{4,}|\x09{1,})[^`<>:\n\r].*$\n)+ ^$'
so you need empty line above code + empty line below.

b. coloring changes when edition touches 1st line of block.

Re: Tab-indented code block rendering issue

Posted: 02.10.2025 14:11
by katwalk
Thank you for the explanation, I finally understand.