PaloAltoNetworks / PaloAltoNetworks/docusaurus-openapi-docs
Strip markdown from parameter placeholder
@sserrata is already working on this.
Since Nov 22, 2024.
- Dominant language
- TypeScript
- Stars
- 1.1k
- Forks
- 315
- Avg merge
- 7d 5h
- Merged PRs (30d)
- 7
Description
Describe the bug
Have a parameter defined for some path.
That parameter can have a description which according to the OAS spec supports CommonMark syntax.
This description is used by packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.tsx (and ParamArrayFormItem.tsx) as placeholder on the <FormTextInput>.
This would show raw markdown if description contains markdown (e.g. a raw markdown link such as leading [Some link](/pointing/somewhere) trailing.
Expected behavior
Strip the markdown to plaintext so the placeholder text is readable. The correctly rendered markdown is anyways in the main section.
So leading [Some link](/pointing/somewhere) trailing should become leading Some link trailing.
Current behavior
Raw markdown is rendered as text.
Possible solution
Maybe use something like https://github.com/remarkjs/strip-markdown to strip non markdown elements.
Your Environment
- Version used: 4.1.0
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.
Assessment
This issue has not been assessed yet.