Markdown headers in OpenApi description not rendered properly when using italic/bold in headers
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 25.9k
- Forks
- 2.4k
- Avg merge
- 13h 10m
- Merged PRs (30d)
- 4
Description
Describe the bug
Markdown headers in OpenApi description field is not rendered properly when using italic or bold text. Headers are displayed twice, first with html tags visible and without the content, then properly. The sidenav shows only the malformatted titles, it breaks the navigation within the OpenApi specification.
Expected behavior
Headers should be displayed only once, properly formatted with the content under it, even if bold or italic text is used. Navigation with sidenav should work.
Minimal reproducible OpenAPI snippet(if possible)
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Example spec",
"description": "# Header 1\n\n## Header 1.1 with **bold**\nSome content in section 1.1\n\n## Header 1.2 with _italic_\n Some more content in section 1.2"
}
}
Screenshots
Here is the result after rendering
Additional context
I am using Redoc 2.5.2 in an Angular application.
The rendering is good if italic/bold is not used in headers.
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
No source file or test is named. Start by reproducing the issue with the supplied OpenAPI 3.0 snippet in Redoc 2.5.2, then trace the Markdown rendering and sidenav generation paths. Done means bold and italic headers render once with their content and produce correct navigation titles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- markdown
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100