diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-12-06 16:05:27 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-12-06 16:05:50 -0800 |
commit | f6007e7146460643a8fe4a4d3434001c6ef136bb (patch) | |
tree | 627721369f9834cbc9daf98dfc753c8a42d4be42 | |
parent | 4066a385ace1cee53336bf4c10734239044a92ae (diff) | |
download | pandoc-f6007e7146460643a8fe4a4d3434001c6ef136bb.tar.gz |
Markdown reader: accept processing instructions as raw HTML.
Closes #4125.
-rw-r--r-- | src/Text/Pandoc/Readers/HTML.hs | 5 | ||||
-rw-r--r-- | test/command/4125.md | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index b0f5d38f9..f5f296712 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -1155,8 +1155,9 @@ htmlTag f = try $ do -- in XML element names let isNameChar c = isAlphaNum c || c == ':' || c == '-' || c == '_' let isName s = case s of - [] -> False - (c:cs) -> isLetter c && all isNameChar cs + [] -> False + ('?':_) -> True -- processing instruction + (c:cs) -> isLetter c && all isNameChar cs let endpos = if ln == 1 then setSourceColumn startpos diff --git a/test/command/4125.md b/test/command/4125.md new file mode 100644 index 000000000..8bf09d84c --- /dev/null +++ b/test/command/4125.md @@ -0,0 +1,6 @@ +``` +% pandoc +<?asciidoc-toc?> +^D +<?asciidoc-toc?> +``` |