Vscode-markdown: syntax.decorations: The phase of recognizing <code> tag is broken

Created on 9 Mar 2019  ·  8Comments  ·  Source: yzhang-gh/vscode-markdown

What is the problem?

Look at this markdown below:

```a`a```

This markdown text should be converted like below HTML

<code>a`a</code>

a`a

markdown-it recognize this correctly.

image

However, vscode-markdown recognize like below:

``<code>a</code>`a```

As a result, in editor view, decoration rectangle drawing result is strange.

img

How can I reproduce it?

  1. "markdown.extension.syntax.decorations": true
  2. create new markdown file
  3. paste
```a`a```

Environment

  • Windows 10 Home 1809
  • Visual Studio Code 1.31.0 or later
  • Markdown All in One 2.1.1

ref:

Bug

All 8 comments

Thank you for the report. Looks a bit hard to handle...

It should be fixed in the dev build.

@yzhang-gh I install build 1.0.29, then, work fine!

BTW, Another pattern cause bug found...

`a
a`

This should be recognize like <code>a a</code>.
image

You are right. However vscode decorations cannot cover multi-lines. So this is the best we can do now.

vscode decorations cannot cover multi-lines.

I'm not sure about vscode decorations. However, as far as I see, Bracket Pair Colorizer do it (bracketPairColorizer.showVerticalScopeLine, I don't know Bracket Pair Colorizer really use vscode decorations system to draw)
image


How do you think about code tag syntax in code block syntax?

```
aaa
`a`
a
`````
    ```a```

image

The multi-line thing

This is the upstream issue. _Bracket Pair Colorizer_ might have used some tricks (technically, we can fake multi-line decoration with multiple single-line decorations 😂). However, I am not a fan of this.


Decorations inside code blocks

Interesting. It is doable to disable decorations there. I can look into it this weekend.

I have disabled decorations in the fenced code blocks. However, I didn't touch the indented code blocks. There are many corner cases if we want to perfectly determine the indented code blocks. I don't think it is worth that effort.

Thank you for your fix!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jerry-sky picture jerry-sky  ·  4Comments

akshaybabloo picture akshaybabloo  ·  3Comments

akurani picture akurani  ·  4Comments

maoturing picture maoturing  ·  4Comments

lengyingzi picture lengyingzi  ·  5Comments