parent
48115fcf1a
commit
38200c0291
2 changed files with 15 additions and 1 deletions
|
@ -57,7 +57,12 @@ escapeCharForXML x = case x of
|
|||
|
||||
-- | Escape string as needed for XML. Entity references are not preserved.
|
||||
escapeStringForXML :: String -> String
|
||||
escapeStringForXML = concatMap escapeCharForXML
|
||||
escapeStringForXML = concatMap escapeCharForXML . filter isLegalXMLChar
|
||||
where isLegalXMLChar c = c == '\t' || c == '\n' || c == '\r' ||
|
||||
(c >= '\x20' && c <= '\xD7FF') ||
|
||||
(c >= '\xE000' && c <= '\xFFFD') ||
|
||||
(c >= '\x10000' && c <= '\x10FFFF')
|
||||
-- see https://www.w3.org/TR/xml/#charsets
|
||||
|
||||
-- | Escape newline characters as
|
||||
escapeNls :: String -> String
|
||||
|
|
9
test/command/5119.md
Normal file
9
test/command/5119.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
```
|
||||
% pandoc -t docbook
|
||||
hi
|
||||
^D
|
||||
<para>
|
||||
hi
|
||||
</para>
|
||||
```
|
||||
|
Loading…
Add table
Reference in a new issue