Skip to content

Vapor text is incorrectly escaped #14309

@scottbedard

Description

@scottbedard

Vue version

3.6.0-beta.3

Link to minimal reproduction

https://play.vuejs.org/#eNp9kEFLw0AQhf9KmIuXuhUiHkooqBTUg4p6XJCYjDF1s7vszqYpJf/d2Q2tPZTedt/3ZnjzdnBrregDwgIKX7nWUtaX1rhlMZ++S6mlLgg7q0pC/mXZg9nU22x7USrFaH7EYAbkK6O/20asvdG8dRcnJFSms61C92KpNdpLWGSJRMZ7zOYpaeQCzvZ69YPV7wl97YeoSXh16NH1KOHAqHQN0oRX78848PsAO1MHxe4z8A29USFmnGx3Qdcc+8iX0j523BG1uvnwq4FQ+/1RMWh0jskvgau9P3P6f9xcXKc5qUdu8bNHF3dygbm4EVeXX0ilyGH8AwY4jXE=

Steps to reproduce

Render text in a vapor component with potentially dangerous characters, like ' or &

What is expected?

Text should be rendered normally

What is actually happening?

Characters like ' and " are escaped to strings ' and ". Presumably this is true for all dangerous characters, but I haven't checked them all.

System Info

System:
    OS: macOS 14.7.6
    CPU: (10) arm64 Apple M1 Pro
    Memory: 731.50 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.10.0 - /Users/scottbedard/.nvm/versions/node/v24.10.0/bin/node
    npm: 11.6.1 - /Users/scottbedard/.nvm/versions/node/v24.10.0/bin/npm
    pnpm: 9.7.0 - /Users/scottbedard/Library/pnpm/pnpm
    Deno: 2.4.2 - /Users/scottbedard/.deno/bin/deno
  Browsers:
    Brave Browser: 141.1.83.118
    Chrome: 143.0.7499.193
    Firefox: 146.0.1
    Firefox Nightly: 129.0a1
    Safari: 17.6
  npmPackages:
    vue: 3.5.26 => 3.5.26

Any additional comments?

I found this error after playing with #14273. Text as the lone-content of a vnode behaves this way. Special characters and HTML entities render correctly when they are the inner content of a dom element, but not as a lone text node.

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