Markdown reader: accept processing instructions as raw HTML.

Closes #4125.
This commit is contained in:
John MacFarlane 2017-12-06 16:05:27 -08:00
parent 4066a385ac
commit f6007e7146
2 changed files with 9 additions and 2 deletions

View file

@ -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

6
test/command/4125.md Normal file
View file

@ -0,0 +1,6 @@
```
% pandoc
<?asciidoc-toc?>
^D
<?asciidoc-toc?>
```