aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/XML.hs
AgeCommit message (Collapse)AuthorFilesLines
2021-04-05JATS writer: escape disallows chars in identifiersAlbert Krewinkel1-2/+28
XML identifiers must start with an underscore or letter, and can contain only a limited set of punctuation characters. Any IDs not adhering to these rules are rewritten by writing the offending characters as Uxxxx, where `xxxx` is the character's hex code.
2021-02-18T.P.XML Improve fromEntities.John MacFarlane1-17/+13
2021-01-08Update copyright notices for 2021 (#7012)Albert Krewinkel1-1/+1
2020-09-13Fix hlint suggestions, update hlint.yaml (#6680)Christian Despres1-1/+2
* Fix hlint suggestions, update hlint.yaml Most suggestions were redundant brackets. Some required LambdaCase. The .hlint.yaml file had a small typo, and didn't ignore camelCase suggestions in certain modules.
2020-03-19Add to html5 attributes.John MacFarlane1-0/+7
Add: allow, autocapitalize, decoding, enterkeyhint, imagesizes, imagesrcset, loading.
2020-03-15Use implicit Prelude (#6187)Albert Krewinkel1-2/+0
* Use implicit Prelude The previous behavior was introduced as a fix for #4464. It seems that this change alone did not fix the issue, and `stack ghci` and `cabal repl` only work with GHC 8.4.1 or newer, as no custom Prelude is loaded for these versions. Given this, it seems cleaner to revert to the implicit Prelude. * PandocMonad: remove outdated check for base version Only base versions 4.9 and later are supported, the check for `MIN_VERSION_base(4,8,0)` is therefore unnecessary. * Always use custom prelude Previously, the custom prelude was used only with older GHC versions, as a workaround for problems with ghci. The ghci problems are resolved by replacing package `base` with `base-noprelude`, allowing for consistent use of the custom prelude across all GHC versions.
2020-03-13Update copyright year (#6186)Albert Krewinkel1-1/+1
* Update copyright year * Copyright: add notes for Lua and Jira modules
2020-02-12Moved html5Attributes, html4Attributes, rdfaAttributes...John MacFarlane1-1/+352
from T.P.Writers.HTML (where they were unexported) to T.P.XML (where they are now exported). [API change: new exported functions] This allows these sets to be used elsewhere, e.g. in the HTML reader.
2019-11-12Switch to new pandoc-types and use Text instead of String [API change].despresc1-35/+39
PR #5884. + Use pandoc-types 1.20 and texmath 0.12. + Text is now used instead of String, with a few exceptions. + In the MediaBag module, some of the types using Strings were switched to use FilePath instead (not Text). + In the Parsing module, new parsers `manyChar`, `many1Char`, `manyTillChar`, `many1TillChar`, `many1Till`, `manyUntil`, `mantyUntilChar` have been added: these are like their unsuffixed counterparts but pack some or all of their output. + `glob` in Text.Pandoc.Class still takes String since it seems to be intended as an interface to Glob, which uses strings. It seems to be used only once in the package, in the EPUB writer, so that is not hard to change.
2019-10-29Changes to build with new doctemplates/doclayout.John MacFarlane1-5/+8
The new version of doctemplates adds many features to pandoc's templating system, while remaining backwards-compatible. New features include partials and filters. Using template filters, one can lay out data in enumerated lists and tables. Templates are now layout-sensitive: so, for example, if a text with soft line breaks is interpolated near the end of a line, the text will break and wrap naturally. This makes the templating system much more suitable for programatically generating markdown or other plain-text files from metadata.
2019-09-03XML: change toEntities to emit numerical hex character references.John MacFarlane1-1/+2
Previously decimal references were used. But Polyglot Markup prefers hex. See #5718. This affects the output of pandoc with `--ascii`.
2019-08-25Use new doctemplates, doclayout.John MacFarlane1-6/+8
+ Remove Text.Pandoc.Pretty; use doclayout instead. [API change] + Text.Pandoc.Writers.Shared: remove metaToJSON, metaToJSON' [API change]. + Text.Pandoc.Writers.Shared: modify `addVariablesToContext`, `defField`, `setField`, `getField`, `resetField` to work with Context rather than JSON values. [API change] + Text.Pandoc.Writers.Shared: export new function `endsWithPlain` [API change]. + Use new templates and doclayout in writers. + Use Doc-based templates in all writers. + Adjust three tests for minor template rendering differences. + Added indentation to body in docbook4, docbook5 templates. The main impact of this change is better reflowing of content interpolated into templates. Previously, interpolated variables were rendered independently and intepolated as strings, which could lead to overly long lines. Now the templates interpolated as Doc values which may include breaking spaces, and reflowing occurs after template interpolation rather than before.
2019-03-01Remove license boilerplate.John MacFarlane1-18/+0
The haddock module header contains essentially the same information, so the boilerplate is redundant and just one more thing to get out of sync.
2019-02-04Add missing copyright notices and remove license boilerplate (#5112)Albert Krewinkel1-2/+2
Quite a few modules were missing copyright notices. This commit adds copyright notices everywhere via haddock module headers. The old license boilerplate comment is redundant with this and has been removed. Update copyright years to 2019. Closes #4592.
2018-12-04Strip out illegal XML characters in escapeXMLString.John MacFarlane1-1/+6
Closes #5119.
2018-11-22Hlint suggestions.John MacFarlane1-2/+1
2018-11-04XML: toHtml5Entities: prefer shorter entities...John MacFarlane1-3/+10
when there are several choices for a particular character.
2018-11-01Text.Pandoc.XML: add toHtml5Entities.John MacFarlane1-0/+18
[API change]
2018-03-18Use NoImplicitPrelude and explicitly import Prelude.John MacFarlane1-0/+2
This seems to be necessary if we are to use our custom Prelude with ghci. Closes #4464.
2018-01-05Update copyright notices to include 2018Albert Krewinkel1-2/+2
2017-06-11Switched Writer types to use Text.John MacFarlane1-5/+6
* XML.toEntities: changed type to Text -> Text. * Shared.tabFilter -- fixed so it strips out CRs as before. * Modified writers to take Text. * Updated tests, benchmarks, trypandoc. [API change] Closes #3731.
2017-05-13Update dates in copyright noticesAlbert Krewinkel1-2/+2
This follows the suggestions given by the FSF for GPL licensed software. <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane1-9/+9
2016-09-02Remove TagSoup compatJesse Rosenthal1-2/+2
We already lower-bound tagsoup at 0.13.7, which means we were always running the compatibility layer (it was conditional on min value 0.13). Better to just use `lookupEntity` from the library directly, and convert a string to a char if need be.
2016-03-22Updated copyright dates to include 2016.John MacFarlane1-2/+2
2016-01-08Fixed shadowing warning.John MacFarlane1-1/+1
2016-01-08Work around tagsoup bug - not allowing uppercase x in hex entities.John MacFarlane1-0/+1
Issue submitted at tagsoup.
2016-01-08Entity handling fixes:John MacFarlane1-2/+6
- Text.Pandoc.XML.fromEntities: handle entities without a semicolon. Always lookup character references with the trailing ';', even if it wasn't present. And never add it when looking up numerical entities. (This is what tagsoup seems to require.) - Text.Pandoc.Parsing.characterReference: Always lookup character references with the trailing ';', and leave off the ';' when looking up numerical entities. This fixes a regression for e.g. `&lang;`.
2015-11-09Revert "Use -XNoImplicitPrelude and 'import Prelude' explicitly."John MacFarlane1-1/+0
This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.
2015-11-08Use -XNoImplicitPrelude and 'import Prelude' explicitly.John MacFarlane1-0/+1
This is needed for ghci to work with pandoc, given that we now use a custom prelude. Closes #2503.
2015-04-26Updated copyright notices to -2015. Closes #2111.John MacFarlane1-2/+2
2014-05-09Update copyright notices for 2014, add missing noticesAlbert Krewinkel1-2/+2
2013-08-08Added Text.Pandoc.Compat.TagSoupEntity.John MacFarlane1-1/+1
This allows pandoc to compile with tagsoup 0.13.x. Thanks to Dirk Ullrich for the patch.
2013-06-24Use new flexible metadata type.John MacFarlane1-12/+1
* Depend on pandoc 1.12. * Added yaml dependency. * `Text.Pandoc.XML`: Removed `stripTags`. (API change.) * `Text.Pandoc.Shared`: Added `metaToJSON`. This will be used in writers to create a JSON object for use in the templates from the pandoc metadata. * Revised readers and writers to use the new Meta type. * `Text.Pandoc.Options`: Added `Ext_yaml_title_block`. * Markdown reader: Added support for YAML metadata block. Note that it must come at the beginning of the document. * `Text.Pandoc.Parsing.ParserState`: Replace `stateTitle`, `stateAuthors`, `stateDate` with `stateMeta`. * RST reader: Improved metadata. Treat initial field list as metadata when standalone specified. Previously ALL fields "title", "author", "date" in field lists were treated as metadata, even if not at the beginning. Use `subtitle` metadata field for subtitle. * `Text.Pandoc.Templates`: Export `renderTemplate'` that takes a string instead of a compiled template.. * OPML template: Use 'for' loop for authors. * Org template: '#+TITLE:' is inserted before the title. Previously the writer did this.
2013-03-19Added Text.Pandoc.Writers.OPML.John MacFarlane1-1/+8
TODO: * Document in README * Add tests * Add template (and add template to cabal file)
2012-04-14Fixed bug in fromEntities.John MacFarlane1-3/+3
The previous version would turn "hi & low you know;" into "hi &".
2012-02-05Fixed bug in fromEntities: require semicolon to process as entity.John MacFarlane1-1/+1
2012-02-05Text.Pandoc.XML: Export fromEntities.John MacFarlane1-1/+15
Remove old 'deEntities' from pandoc.hs.
2012-01-28XML: Added toEntities.John MacFarlane1-1/+10
2010-12-21XML: don't use breaking spaces in attribute lists.John MacFarlane1-4/+5
2010-12-21XML: Replaced escapeStringAsXML with a faster version.John MacFarlane1-9/+1
Benchmarked with criterion, it's about 8x faster than the old version. This speeds up docbook, opendocument, and html writers.
2010-03-23Updated copyright notices.John MacFarlane1-2/+2
2010-01-01XML: don't escape \160 (nonbreaking space) as an entity.fiddlosopher1-2/+1
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1770 788f1e2b-df1e-0410-8736-df70ead52e1b
2009-12-05Added stripTags to Text.Pandoc.XML.fiddlosopher1-1/+12
This is used in the HTML writer. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1647 788f1e2b-df1e-0410-8736-df70ead52e1b
2009-01-24Moved all haskell source to src subdirectory.fiddlosopher1-0/+88
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1528 788f1e2b-df1e-0410-8736-df70ead52e1b