google / gitiles

A simple browser for Git repositories.
https://gerrit.googlesource.com/gitiles/
Other
582 stars 174 forks source link

[TOC] section titles don't render content in backticks #105

Open mgiuffrida opened 7 years ago

mgiuffrida commented 7 years ago

Inline code sections in header titles are completely missing from those headers in [TOC] elements.

Example:

[TOC]

# Header One

Paragraph

## `HeaderTwo` (header two)

Paragraph

Here, the second header in the TOC output will be:

(header two)

but should be:

HeaderTwo (header two)

thughes commented 5 years ago

Also seeing this:

Affected Version: 2.16.11-2847-g259bd8ba0024

What steps will reproduce the problem?

  1. Use Markdown backticks (``) in a Markdown heading
  2. Add a table of contents ([TOC])

What is the expected output?

The table of contents should render the Markdown.

What do you see instead?

The table of contents leaves out anything in backticks.

Example with backticks:

https://chromium.googlesource.com/chromiumos/platform2/+/refs/changes/36/1788136/1/biod/README.md

Example without:

https://chromium.googlesource.com/chromiumos/platform2/+/refs/changes/36/1788136/1/biod/README.md

https://crrev.com/c/1788136