diff options
-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?> +``` |