Skip to content

meta tags aren't being escaped in build, producing broken HTML #2831

Closed
@runofthemillgeek

Description

@runofthemillgeek
  • I confirm that this is an issue rather than a question.

Bug report

Steps to reproduce

  1. Create a new VuePress project with the default theme
  2. Add frontmatter with description set to some HTML in a markdown file
  3. Run yarn dev, notice no issues
  4. Run yarn build and open the HTML page, notice broken HTML

I have a reproduction available here: https://github.com/sangeeth96/bug-vuepress-meta-description-repro

What is expected?

Meta tag contents are escaped before being added to HTML.

What is actually happening?

Meta tag contents aren't being escaped resulting in broken HTML.

Other relevant information

  • Output of npx vuepress info in my VuePress project:
    Environment Info:
    
    System:
     OS: macOS 11.2.3
     CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
    Binaries:
     Node: 14.16.1 - ~/.nvm/versions/node/v14.16.1/bin/node
     Yarn: 1.22.10 - /usr/local/bin/yarn
     npm: 6.14.12 - ~/.nvm/versions/node/v14.16.1/bin/npm
    Browsers:
     Chrome: 90.0.4430.72
     Edge: Not Found
     Firefox: Not Found
     Safari: 14.0.3
    npmPackages:
     @vuepress/core:  1.8.2 
     @vuepress/theme-default:  1.8.2 
     vuepress: ^1.3.1 => 1.8.2 
    npmGlobalPackages:
     vuepress: Not Found
    

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