DocBook reader: Fix bug with entities in mathphrase element.

Closes #5885.
This commit is contained in:
John MacFarlane 2019-11-07 23:08:05 -08:00
parent b44a4c803e
commit 3bf5362898
2 changed files with 22 additions and 4 deletions

View file

@ -1109,12 +1109,10 @@ equation e constructor =
$ filterChildren childPredicate e
)
-- | Get the actual text stored in a verbatim CData block. 'showContent'
-- | Get the actual text stored in a CData block. 'showContent'
-- returns the text still surrounded by the [[CDATA]] tags.
--
-- Returns 'showContent' if this is not a verbatim CData
showVerbatimCData :: Content -> String
showVerbatimCData (Text (CData CDataVerbatim d _)) = d
showVerbatimCData (Text (CData _ d _)) = d
showVerbatimCData c = showContent c
-- | Set the prefix of a name to 'Nothing'

20
test/command/5885.md Normal file
View file

@ -0,0 +1,20 @@
```
% pandoc -f docbook -t latex
<equation>
<mathphrase>
J(x, y) = \left\{ \begin{array}{ll}
0 &amp; \text{if $I(x, y) &lt; t$} \\
1 &amp; \text{if $I(x, y) \ge t$}
\end{array}
\right.
</mathphrase>
</equation>
^D
\[
J(x, y) = \left\{ \begin{array}{ll}
0 & \text{if $I(x, y) < t$} \\
1 & \text{if $I(x, y) \ge t$}
\end{array}
\right.
\]
```