microsoft / vscode-markdown-tm-grammar

VS Code built-in markdown extension's Textmate grammar
MIT License
64 stars 49 forks source link

Markdown highlighting not working directly after an HTML tag #85

Open MangelMaxime opened 3 years ago

MangelMaxime commented 3 years ago

Steps to Reproduce:

  1. In a markdown file write:
<div></div>
# Title

<div></div>
**test**
  1. See that the title and the bold text are not highlighted. image

To fix this problem, the user can add an empty line:

image

But when using an extension which adds an anchor to titles for generating Table of Content, for example, we don't always have the control of where the HTML elements are being added.

Does this issue occur when all extensions are disabled?: Yes

vscodebot[bot] commented 3 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

mjbvz commented 3 years ago

This matches how the markdown is rendered:

Screen Shot 2020-12-17 at 10 58 46 AM

Github has the same behavior:

Title

test

MangelMaxime commented 3 years ago

Sorry @mjbvz, when reporting the issue I changed the HTML element used compared to my code because I thought it was the same for all of them.

The code I used in my application is actually using anchor HTML element.

<a href="dzdz"></a>
# Title

<a href="dzdz"></a>
**test**

I just checked on VSCode and Github the markdown is being rendered correctly.

image


GitHub demo:

Title

test

End of GitHub demo


I guess there is a special case for the anchor element here.

jonathan-regeimbal commented 1 year ago

This is still a bug today. Note that the last line beginning with *Pushed... does not have Markdown highlighting applied:

GHE Dev Terraform Plan 📖success

Show Plan ```hcl Some content ```

Pushed by: @jonathan-regeimbal, Commit: blank, Action: pull_request