Skip to content

Comments can end up displaying inside description meta #6108

Open
@jmynes

Description

@jmynes

Have you read the Contributing Guidelines on issues?

  • I have read the Contributing Guidelines on issues.

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

Issue: My .md or .mdx files are loading comments into the content of the meta property og:description
<meta property="og:description" content="<!-- This comment WILL NOT be ignored:" data-react-helmet="true">

Steps to reproduce

Example code structure to replicate this issue:

---
slug: /link_here
title: Title text here
---

<!--
  This comment will be ignored:
-->
<head>
  <meta name="description" content="This description will work correctly" />
</head>

<!-- This comment WILL NOT be ignored:
 - Point 1
 - Point 2
 -  etc -->

Page text here, lorem ipsum etc etc etc

## h2, etc etc etc

Expected behavior

og:description should not be pulling comments in to fill its content

Actual behavior

og:description seems to pull the first text after even if it's a comment?

No log messages output.

Your environment

  • Docusaurus version used: 2.0.0-beta.13, & 2.0.0-beta.9
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): Edge Version 96.0.1054.57 (Official build) (64-bit)
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows 10 Pro - 21H2

I have already fixed this issue in prod on our site's affected page, https://docs.domination.finance/liquidity_providers, by manually overriding the meta tag for og:description

Reproducible demo

No response

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its executiondomain: markdownRelated to Markdown parsing or syntax

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions