docusaurus-openapi-docs icon indicating copy to clipboard operation
docusaurus-openapi-docs copied to clipboard

Strip markdown syntax from frontmatter

Open omonk opened this issue 1 year ago • 0 comments

Describe the bug

When rendering a DocCard, the frontmatter description is used - https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-theme-classic/src/theme/DocCard/index.tsx#L80-L86

This plugin currently puts markdown into the frontmatter, the DocCard component does not transform markdown to HTML so markdown syntax is rendered.

Expected behavior

Frontmatter is not generated with markdown syntax

frontmatter: Endpoint used to get a Profile

Current behavior

Frontmatter has markdown in it

frontmatter: Endpoint used to get a [Profile](./path/to/profile)

Possible solution

None

This splitDescription method is used throughout createItems. I guess stripping with something like this might work

Steps to reproduce

  1. Clone https://github.com/omonk/spec-render-bug
  2. git checkout frontmatter-markdown
  3. http://localhost:3002/docs/test-spec/update
  4. See DocCard is rendered with get description

Screenshots

image image

Context

It looks unprofessional

omonk avatar Aug 06 '24 10:08 omonk