Skip to content

Backslash in tag attribute value is escaped in Astro #1091

@debiru

Description

@debiru

Astro Info

Astro                    v5.7.11
Node                     v22.13.1
System                   Linux (x64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             myExt:integration

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

No response

Describe the Bug

If the following description is made in the astro file in src, the html file of the build result will look like the following.

.astro file in src directory

<input pattern="^example\.com$" />

.html file in dist directory

<input pattern="^example.com$" />

What's the expected result?

.html file in dist directory

<input pattern="^example\.com$" />

instead of

<input pattern="^example.com$" />

(The backslash is removed in the unexpected result)

Link to Minimal Reproducible Example

https://stackblitz.com/edit/withastro-astro-qxxakjka?file=src%2Fpages%2Findex.astro

Participation

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions