Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 BUG: Missing trailing backslash in void elements breaks code highlighting when inside a map method #852

Closed
Axelgustavschnurer opened this issue Apr 12, 2024 · 1 comment
Labels
needs triage Issue needs to be triaged

Comments

@Axelgustavschnurer
Copy link

Describe the Bug

As title suggests, using a void element such as
without a trailing backslash and within a map method causes syntax highlighting to break. Example in the code below:

---
let data = [
  'string 1',
  'string 2',
  'string 3'
]
---

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
    <meta name="viewport" content="width=device-width" />
    <meta name="generator" content={Astro.generator} />
    <title>Astro</title>
  </head>
    <body>
      <h1>Astro</h1>
        {data.map(element => (
	  <p>{element}</p><br>
        ))}
  </body>
</html>

Steps to Reproduce

  1. npm create astro@latest
  2. Create an array
  3. Use the map method to map the array
  4. Use any void element without a trailing backslash in the map method, ex.
    , or
  5. The syntax highlighting for the map function aswell as some closing html tags beneath the void element breaks.
  6. The expected behavior should be that the void element behaves as it does outside the mapping function, where the lack of a trailing backslash does not cause the syntax highlighting to break.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Apr 12, 2024
@Princesseuh
Copy link
Member

Duplicate of #708

@Princesseuh Princesseuh marked this as a duplicate of #708 Apr 13, 2024
@Princesseuh Princesseuh closed this as not planned Won't fix, can't repro, duplicate, stale Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants