git.iko.soy/typeable/pandoc
on master help sign in
Markdown reader: accept processing instructions as raw HTML.

Closes #4125.

commitf6007e7146460643a8fe4a4d3434001c6ef136bb authorJohn MacFarlane <jgm@berkeley.edu> dateWed 6 Dec 2017, 16:05 (9 years ago) parent4066a38
2 files changed+9−2
src/Text/Pandoc/Readers/HTML.hs+3−2 test/command/4125.md+6
src/Text/Pandoc/Readers/HTML.hs+3−2
@@ -1155,8 +1155,9 @@ htmlTag f = try $ do
11551155 -- in XML element names
11561156 let isNameChar c = isAlphaNum c || c == ':' || c == '-' || c == '_'
11571157 let isName s = case s of
1158− [] -> False
1159− (c:cs) -> isLetter c && all isNameChar cs
1158+ [] -> False
1159+ ('?':_) -> True -- processing instruction
1160+ (c:cs) -> isLetter c && all isNameChar cs
11601161
11611162 let endpos = if ln == 1
11621163 then setSourceColumn startpos
test/command/4125.mdnew file+6
@@ -0,0 +1,6 @@
1+```
2+% pandoc
3+<?asciidoc-toc?>
4+^D
5+<?asciidoc-toc?>
6+```