Skip to content

pandocDelimitedCodeBlock should not requires preceeding or leading empty line #335

Open
@soraxas

Description

@soraxas

Hi!

Is there a reason why the code block conceal requires an empty line before and after the three backticks at line 439 and 441?

call s:WithConceal('codeblock_start', 'syn match pandocDelimitedCodeBlockStart /\(\_^\n\_^\(>\s\)\?\([ ]\{4,}\|\t\)\=\)\@<=\(\~\{3,}\~*\|`\{3,}`*\)/ contained containedin=pandocDelimitedCodeBlock nextgroup=pandocDelimitedCodeBlockLanguage', 'conceal cchar='.s:cchars['codelang'])

The pandocDelimitedCodeBlockStart regex requires two preceding ^ (line 439) and pandocDelimitedCodeBlockEnd requires two leading $ (line 441) which means it needs a blank line before and after.

But as far as I can tell, in markdown the three backticks that begins a block of code can be followed right after text, and the same goes for the ending of code block (can be followed by non-empty lines). They should be valid syntax.

See the following:

Without enabling syntax
a

Current behaviour
b

After I edited the code, made it only requires one preceding ^ and leading $ for the begin/end of code regex.
c

I would expect the third scenario for concealing. Note that highlighting works as expected (as seen by the illustrations), it's only the conceal that doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions