md-to-toc icon indicating copy to clipboard operation
md-to-toc copied to clipboard

TOC Hyperlinks break when titles have `code tags` in them

Open tjwieg opened this issue 7 years ago • 0 comments

If any headers have code tags in them, the automatically generated hyperlinks don't work. To fix this, simply remove any backticks (`) from the links.

An example with broken links due to backticks in links: https://github.com/rbotts/Occupancy/blob/446c2205c8c78eddc87ebd20a86e1bad850dfdea/UnmarkedGuide.md (note that the two TOC items without any code tags have working links, but all the TOC items with code tags, such as "Creating colext models" do not have working links.)

An example with those links fixed by removing the backticks: https://github.com/rbotts/Occupancy/blob/f134cb8cb9626463e71df73c01681112eb004e9b/UnmarkedGuide.md (note that now even the TOC items with code tags do have working links.

The diff between the two: https://github.com/rbotts/Occupancy/commit/f134cb8cb9626463e71df73c01681112eb004e9b#diff-776f5c8d16bf7b01e8f44ec08d2ac678

tjwieg avatar Jul 05 '18 20:07 tjwieg