eternalmisa / pagedown

Automatically exported from code.google.com/p/pagedown
Other
0 stars 0 forks source link

Converter allows for headings up to h6, but sanitizer removes anything after h3. #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. var converter = Markdown.getSanitizingConverter();
2. converter.makeHtml( '#h4-header')
3. the text 'h4-header' is returned.

What is the expected output? What do you see instead?
I expected '<h4>h4-header</h4>' to be returned

What version of the product are you using? On what operating system?
Latest version, OS X 10.7

Please provide any additional information below.

The issue is that on line 23 of Markdown-Sanitizer.js a whitelist is declared 
that only allows h tags up to h3.  However, line 747 of the 
Markdown-Converter.js allows h1-h6. Adding h4-h6 to the whitelist fixed the 
issues.

Original issue reported on code.google.com by dmar...@groupon.com on 5 Jul 2012 at 4:52

GoogleCodeExporter commented 8 years ago

Original comment by b...@stackoverflow.com on 5 Jul 2012 at 4:53

GoogleCodeExporter commented 8 years ago
This is a duplicate of Issue 29, I apologize.

Original comment by dmar...@groupon.com on 5 Jul 2012 at 4:54

GoogleCodeExporter commented 8 years ago
If anyone wants ATX header support for H1-H4 (can be easily adapted to H1-H6 
etc) using the header button see 
https://gist.github.com/dotnetchris/0f68c879082343295503

Original comment by ch...@marisic.com on 30 Sep 2014 at 5:57