Skip to content
This repository was archived by the owner on Apr 19, 2024. It is now read-only.
This repository was archived by the owner on Apr 19, 2024. It is now read-only.

Markdown Theme Kit: Inline SVG inside HTML - line breaks in SVG elements sets wrong textmate scope for quoted text #42

@sidewayss

Description

@sidewayss

vscode-linebreak

The top line in the attached image is the correct color for quoted text in this context. I want to format with line breaks for readability, but the color change makes things less readable. I have reviewed the Inspect Editor Tokens and Scopes and the main difference between the first two paths is that "standard token type" is "String" for the first path and "Other" for the second path. The "textmate scopes" are different, but very similar, both starting with string.quoted.double.html.
The "foreground" for the first path is:
string { "foreground": "#BC670F", "background": "#FBE9AD1A", "fontStyle": "" }
For the second path it's:
meta.tag string.quoted { "foreground": "#6D98CF" }
The third path is included in the image to illustrate the possibility that VSCode thinks that the line break means that the SVG element is not properly terminated, even though it is.

See https://stackoverflow.com/questions/76148772/visual-studio-code-line-break-in-svg-element-declaration-changes-literal-text

I wanted to attach a .html file example here, but it only accepts image files. It's a small file so I'll drop it right here:

<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
  </head>
  <body>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
      <path id="oneLine" d="M1,1 L2,2"/>
      <path id="twoLines"
            d="M1,1 L2,2"/>
    </svg>
  </body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions