PaloAltoNetworks / PaloAltoNetworks/docusaurus-openapi-docs
Strip markdown syntax from frontmatter
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.1k
- Forks
- 315
- Avg merge
- 7d 5h
- Merged PRs (30d)
- 7
Description
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
- Clone https://github.com/omonk/spec-render-bug
git checkout frontmatter-markdown- http://localhost:3002/docs/test-spec/update
- See DocCard is rendered with
getdescription
Screenshots
Context
It looks unprofessional
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with splitDescription in packages/docusaurus-plugin-openapi-docs/src/openapi/openapi.ts and trace how createItems places its result into frontmatter; the DocCard reference in packages/docusaurus-theme-classic/src/theme/DocCard/index.tsx shows why raw markdown is exposed. Reproduce the issue with the linked spec-render-bug steps, then verify that generated descriptions contain plain text such as “Endpoint used to get a Profile” rather than markdown links.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100