markdown-pp icon indicating copy to clipboard operation
markdown-pp copied to clipboard

Wonky mangulation of header tags when creating <a> tags for !TOC

Open ssteinerx opened this issue 7 years ago • 0 comments

This file, test1.mdpp:

# test.mdpp -- **H1**

## Table of Contents below -- \<H2\>
!TOC

## Test H2 that includes "some things in quotes" ##
Moar text

Produces this:

# test2.mdpp -- **H1**

## Table of Contents below -- \<H2\>
1\.  [Test H2 that includes "some things in quotes" ##](#testh2thatincludes"somethingsinquotes"##)

<a name="testh2thatincludes"somethingsinquotes"##"></a>

## 1\. Test H2 that includes "some things in quotes" ##
Moar text

The header that has quoted text completely baffle the link creator and it puts together a name field that is strings of stuff with embedded double quotes and bare strings that shouldn't be valid even if they can accidentally be parsed. Who knows what evil lurks within the hearts of HTML parsers, really?

I didn't get any further than that in my current explorations because I'm really only after the !INCLUDE functionality, but some docs with warnings or smartening up the tag creator (with some edge-case bending tests) might be in order.

I don't have time to create a pull request now, I just wanted to record this before it got away.

ssteinerx avatar Apr 26 '17 19:04 ssteinerx