pandoc-3.1.10: Conversion between markup formats
CopyrightCopyright (C) 2021-2023 John MacFarlane
LicenseGNU GPL, version 2 or above
MaintainerJohn MacFarlane <jgm@berkeley.edu>
Stabilityalpha
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.Pandoc.XML.Light

Description

xml-light, which we used in pandoc's the XML-based readers, has some limitations: in particular, it produces nodes with String instead of Text, and the parser falls over on processing instructions (see #7091).

This module exports much of the API of xml-light, but using Text instead of String. In addition, the xml-light parsers are replaced by xml-conduit's well-tested parser. (The xml-conduit types are mapped to types isomorphic to xml-light's, to avoid the need for massive code modifications elsewhere.) Bridge functions to map xml-light types to this module's types are also provided (since libraries like texmath still use xml-light).

Another advantage of the xml-conduit parser is that it gives us detailed information on xml parse errors.

In the future we may want to move to using xml-conduit or another xml library in the code base, but this change gives us better performance and accuracy without much change in the code that used xml-light.

Synopsis

Documentation

Replacement for xml-light's Text.XML.Input