@@ -74,6 +74,7 @@ import Text.Printf (printf)
7474import Text.XML.Light (Attr (..), Element (..), Node (..), QName (..),
7575 add_attrs, lookupAttr, node, onlyElems, parseXML,
7676 ppElement, showElement, strContent, unode, unqual)
77+import Text.Pandoc.XML (escapeStringForXML)
7778
7879-- A Chapter includes a list of blocks and maybe a section
7980-- number offset. Note, some chapters are unnumbered. The section
@@ -446,7 +447,8 @@ pandocToEPUB version opts doc@(Pandoc meta _) = do
446447 cpContent <- lift $ writeHtml
447448 opts'{ writerVariables =
448449 ("coverpage","true"):
449− ("pagetitle",plainTitle):
450+ ("pagetitle",
451+ escapeStringForXML plainTitle):
450452 cssvars True ++ vars }
451453 (Pandoc meta [RawBlock (Format "html") $ "<div id=\"cover-image\">\n<img src=\"../media/" ++ coverImage ++ "\" alt=\"cover image\" />\n</div>"])
452454 imgContent <- lift $ P.readFileLazy img
@@ -459,7 +461,7 @@ pandocToEPUB version opts doc@(Pandoc meta _) = do
459461 -- title page
460462 tpContent <- lift $ writeHtml opts'{
461463 writerVariables = ("titlepage","true"):
462− ("pagetitle",plainTitle):
464+ ("pagetitle", escapeStringForXML plainTitle):
463465 cssvars True ++ vars }
464466 (Pandoc meta [])
465467 tpEntry <- mkEntry "text/title_page.xhtml" tpContent
@@ -754,7 +756,8 @@ pandocToEPUB version opts doc@(Pandoc meta _) = do
754756 (writeHtmlStringForEPUB version
755757 opts{ writerTemplate = Nothing
756758 , writerVariables =
757− ("pagetitle",plainTitle):
759+ ("pagetitle",
760+ escapeStringForXML plainTitle):
758761 writerVariables opts}
759762 (Pandoc nullMeta
760763 [Plain $ walk clean tit])) of