Redocly / Redocly/redoc

Markdown headers in OpenApi description not rendered properly when using italic/bold in headers

Open
#2,780 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Bug
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

Image

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.