Skip to content

erronoeous <code> tag rendered in output #983

@WickyNilliams

Description

@WickyNilliams

Astro Info

Astro                    v4.5.5
Node                     v18.15.0
System                   macOS (arm64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

An erroneous <code> element appears in the rendered page if i use this kind of syntax:

<code>{`<foo>`}</code>

Despite the angle brackets in the string being correctly escaped in the output. I don't have the issue if i use this form:

<code>&lt;foo&gt;</code>

But that's a pain to write out, which is how i stumbled across the bug (seeking a simpler alternative).

Strangely, i've only been able to reproduce it when used inside a <table>. After the table, a <code> is rendered in the HTML.

What's the expected result?

No erroenous <code> should be rendered

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-lq1cr7

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P4: importantViolate documented behavior or significantly improves performance (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions