bpruitt-goddard / vscode-mermaid-syntax-highlight

Markdown syntax support for the Mermaid charting language
MIT License
92 stars 36 forks source link

Broken highlight when node text contains HTML tags #17

Closed vstirbu closed 5 years ago

vstirbu commented 5 years ago

The highlight is broken then the text contains HTML tags like <br>. The following example:

graph LR
  working(highlight works)
  broken("broken <br> highlight")
  broken(broken <br> highlight)

yields this result:

screenshot 2019-02-27 at 23 44 42

Plugin version: 1.0.0

bpruitt-goddard commented 5 years ago

I can see a few ways to handle this:

  1. Highlight like the rest of the text
  2. Highlight in proper HTML syntax highlighting
  3. A new mermaid-specific HTML highlighting?

(1) should be easy to do. I don't see (2) being needed unless there is a lot of HTML being written, which I'm assuming doesn't normally happen (correct me if I'm wrong)?

vstirbu commented 5 years ago

Option 1 should be enough for my needs. I use <br> to break long lines.

bpruitt-goddard commented 5 years ago

Awesome! I fixed this in the associated PR.

I pushed out version 1.0.1 of the extension so you should be able to update shortly and see the fixes for both of your bugs. Thanks for the code and screenshots - it made fixing it really easy!