Skip to content

🐛 BUG: Highlighting breaks with TS types at the end of frontmatter w/o a semicolon #14685

@itsMapleLeaf

Description

@itsMapleLeaf

Describe the Bug

If the last part of Astro frontmatter has a TS type and doesn't end with a semicolon, the following content is incorrectly highlighted

Steps to Reproduce

  1. npm init astro
  2. In an Astro file, use this content:
    ---
    type anything = {}
    const a = 123
    ---
    
    <div>
    	<a></a>
    </div>
  3. Comment out the a = 123 line to see unexpected highlighting. The initial state is what it should look like in all cases
Code_zFtAFlNEgm.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P3: minor bugAn edge case that only affects very specific usage (priority)ecosystem: upstreamUpstream package has issuefeat: syntaxIssue in our syntax highlighting (scope)pkg: language-toolsRelated to language-tooling (scope)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions