From 3bf53628984a91d9456d40b1202e9d15f1ad3088 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 7 Nov 2019 23:08:05 -0800 Subject: DocBook reader: Fix bug with entities in mathphrase element. Closes #5885. --- src/Text/Pandoc/Readers/DocBook.hs | 6 ++---- test/command/5885.md | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 test/command/5885.md diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index 4ea5f6657..3f44f83f8 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -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' diff --git a/test/command/5885.md b/test/command/5885.md new file mode 100644 index 000000000..451929b5b --- /dev/null +++ b/test/command/5885.md @@ -0,0 +1,20 @@ +``` +% pandoc -f docbook -t latex + + + 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. + + +^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. + \] +``` -- cgit v1.2.3