git.iko.soy/typeable/pandoc
on master help sign in
DocBook reader: Fix bug with entities in mathphrase element.

Closes #5885.

commit3bf53628984a91d9456d40b1202e9d15f1ad3088 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 7 Nov 2019, 23:08 (7 years ago) parentb44a4c8
2 files changed+22−4
src/Text/Pandoc/Readers/DocBook.hs+2−4 test/command/5885.md+20
src/Text/Pandoc/Readers/DocBook.hs+2−4
@@ -1109,12 +1109,10 @@ equation e constructor =
11091109 $ filterChildren childPredicate e
11101110 )
11111111
1112−-- | Get the actual text stored in a verbatim CData block. 'showContent'
1112+-- | Get the actual text stored in a CData block. 'showContent'
11131113-- returns the text still surrounded by the [[CDATA]] tags.
1114−--
1115−-- Returns 'showContent' if this is not a verbatim CData
11161114showVerbatimCData :: Content -> String
1117−showVerbatimCData (Text (CData CDataVerbatim d _)) = d
1115+showVerbatimCData (Text (CData _ d _)) = d
11181116showVerbatimCData c = showContent c
11191117
11201118-- | Set the prefix of a name to 'Nothing'
test/command/5885.mdnew file+20
@@ -0,0 +1,20 @@
1+```
2+% pandoc -f docbook -t latex
3+<equation>
4+ <mathphrase>
5+ J(x, y) = \left\{ \begin{array}{ll}
6+ 0 &amp; \text{if $I(x, y) &lt; t$} \\
7+ 1 &amp; \text{if $I(x, y) \ge t$}
8+ \end{array}
9+ \right.
10+ </mathphrase>
11+</equation>
12+^D
13+\[
14+ J(x, y) = \left\{ \begin{array}{ll}
15+ 0 & \text{if $I(x, y) < t$} \\
16+ 1 & \text{if $I(x, y) \ge t$}
17+ \end{array}
18+ \right.
19+ \]
20+```