html.tmbundle icon indicating copy to clipboard operation
html.tmbundle copied to clipboard

Incorrect HTML Syntax highlighting on SVG with Line break

Open alexr00 opened this issue 6 years ago • 3 comments

From @marcelcremer on January 29, 2019 13:17

  • VSCode Version: Version: 1.30.2 (system setup) Commit: 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8 Datum: 2019-01-07T22:53:57.820Z Electron: 2.0.12 Chrome: 61.0.3163.100 Node.js: 8.9.3 V8: 6.1.534.41 Betriebssystem: Windows_NT ia32 10.0.17134

  • OS Version: Windows 10

Steps to Reproduce:

Insert the following code in an HTML-File:

<div>
    <svg class="fi">
        <use xlink:href="/assets/feather/feather-sprite.svg#edit" /></svg
        >
</div>

Mind the Line break between </svg and >.

The syntax highlighting will break for everything after the SVG: image

Found through strange SVG formatting by prettier: https://github.com/prettier/prettier/issues/5541

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

Copied from original issue: Microsoft/vscode#67402

alexr00 avatar Jan 31 '19 08:01 alexr00

According to the spec this is valid HTML but the closing tag is categorized as invalid.illegal.unrecognized-tag.html

alexr00 avatar Jan 31 '19 08:01 alexr00

I have tried to fixed this problem in VSCode, but they pointing the problem to this repo.

If someone interested in the resolve, please see https://github.com/microsoft/vscode/pull/124220.

johnsoncodehk avatar May 21 '21 03:05 johnsoncodehk