zhaouv / vscode-markdown-everywhere

Embed and highlight and preview markdown in any language which support line-comment or block-comment for vscode.
https://marketplace.visualstudio.com/items?itemName=zhaouv.vscode-markdown-everywhere
Apache License 2.0
9 stars 3 forks source link

[LITTLE BUG] Same markdown => Result at two places rendered differently! #11

Closed nhwCoder closed 2 months ago

nhwCoder commented 6 months ago

I use in a Python program the same source-markdown at two places but it is different rendered (see attached image) Setting is preview-mode: Ignored

See attached image

RESULT (red numbers)

Empty spaces in markdown should normally not influence/change the rendering result. issue_markdown

zhaouv commented 6 months ago

This rule is the only rules which has free \\s* in whileRegExp (free means no other symbols after this). The preview part firstly remove all whileRegExp, then regard the remain content as markdown. So all indent will be removed for this rule. To fix this, the preview part will have to regard this rule as a special rule, but it will still do not support custom rules which similar to this. It is a known question, but I have not thought a general way to solve it. And I do not want to write a special case for only this rule. I will fix it when I find a general way.

    {
        "name": "whitespace-triple-quote",
        "beginRegExp": "\\s+\"\"\" ?",
        "whileRegExp": "\\s*(?!\\s|\"\"\")",
        "whileSymbol": " ",
        "endRegExp": "\\s*\"\"\" ?",
        "example": "def abc():<br>&nbsp;&nbsp;&nbsp;&nbsp;\"\"\"<br>&nbsp;&nbsp;&nbsp;&nbsp;xxx xxx<br>&nbsp;&nbsp;&nbsp;&nbsp;xxx xxx<br>&nbsp;&nbsp;&nbsp;&nbsp;\"\"\"<br>&nbsp;&nbsp;&nbsp;&nbsp;...",
        "languages": [
            {"name":"julia","source":"source.julia"},
            {"name":"python","source":"source.python"}
        ]
    }